Opened 16 years ago

Closed 14 years ago

Last modified 11 years ago

#4786 closed Uncategorized (duplicate)

Debug page traceback should highlight local code vs. framework code

Reported by: Thomas Güttler <hv@…> Owned by: Kevin McConnell
Component: Core (Other) Version: dev
Severity: Normal Keywords: aug22sprint
Cc: kevin.mcconnell@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The debug traceback is very good.

But if the stacktrace
has many lines, it is hard to find your code.

Here is a simple patch, which guesses if the filename
is my code or djang/python code. If it is my code,
display the filename bold.

Since django and python code have no errors (simley),
I can see the buggy file quicker.

Attachments (4)

views_debug_py.diff (1.2 KB) - added by Thomas Güttler <hv@…> 16 years ago.
views_debug_py.2.diff (1.4 KB) - added by Thomas Güttler <hv@…> 16 years ago.
Better patch.
views_debug_py.3.diff (2.4 KB) - added by Kevin McConnell 15 years ago.
Show bold filenames where file in INSTALLED_APPS
views_debug_py.4.diff (3.7 KB) - added by Thomas Güttler 15 years ago.

Download all attachments as: .zip

Change History (15)

Changed 16 years ago by Thomas Güttler <hv@…>

Attachment: views_debug_py.diff added

comment:1 Changed 16 years ago by Simon G. <dev@…>

Component: UncategorizedMetasystem
Owner: changed from Jacob to Adrian Holovaty
Triage Stage: UnreviewedDesign decision needed

Changed 16 years ago by Thomas Güttler <hv@…>

Attachment: views_debug_py.2.diff added

Better patch.

comment:2 Changed 16 years ago by Adrian Holovaty

Has patch: set
Patch needs improvement: set
Triage Stage: Design decision neededAccepted

I like this idea a lot, but the patch uses a hackish way to determine which code is Django vs. your own code. Could this be improved? Also, the design should be improved -- we should get Wilson's thoughts on this.

comment:3 Changed 16 years ago by Adrian Holovaty

Component: MetasystemCore framework
Summary: debug template: Display my files biggerDebug page traceback should highlight local code vs. framework code

comment:4 Changed 16 years ago by Thomas Güttler <hv@…>

Cc: hv@… added

comment:5 Changed 15 years ago by Kevin McConnell

Owner: changed from nobody to Kevin McConnell

Changed 15 years ago by Kevin McConnell

Attachment: views_debug_py.3.diff added

Show bold filenames where file in INSTALLED_APPS

comment:6 Changed 15 years ago by Kevin McConnell

Cc: kevin.mcconnell@… added
Keywords: aug22sprint added
Patch needs improvement: unset

The attachment views_debug_py.3.diff has a different way of deciding whether a file is "application code" vs. code from Django (and other libs, etc). It gets the load path for each item in INSTALLED_APPS (excluding django.* items), and considers a file to be application code if it falls under one of those paths.

I discussed this with Malcolm during the sprint and he felt this was a reasonable approach. (After all, once you get outside the INSTALLED_APPS directories, it's pretty hard to decide what else to count as part of the application.)

Matching filenames are shown in bold.

comment:7 Changed 15 years ago by Malcolm Tredinnick

milestone: post-1.0

comment:8 Changed 15 years ago by Thomas Güttler

thank you kevin for imporving my patch. I took your solution and changed only a bit:

  • If the application model is defined in app/models/ instead of app/models.py, an other dirname() call is needed.
  • Bold line number and code line

Changed 15 years ago by Thomas Güttler

Attachment: views_debug_py.4.diff added

comment:9 Changed 14 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:10 Changed 14 years ago by Thomas Güttler

Resolution: duplicate
Status: newclosed

#11834 has a more simple way to check for django vs. application code.

comment:11 Changed 11 years ago by Thomas Güttler

Cc: hv@… removed
Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset
Note: See TracTickets for help on using tickets.
Back to Top