Opened 17 years ago

Closed 14 years ago

Last modified 12 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@…> 17 years ago.
views_debug_py.2.diff (1.4 KB ) - added by Thomas Güttler <hv@…> 17 years ago.
Better patch.
views_debug_py.3.diff (2.4 KB ) - added by Kevin McConnell 16 years ago.
Show bold filenames where file in INSTALLED_APPS
views_debug_py.4.diff (3.7 KB ) - added by Thomas Güttler 16 years ago.

Download all attachments as: .zip

Change History (15)

by Thomas Güttler <hv@…>, 17 years ago

Attachment: views_debug_py.diff added

comment:1 by Simon G. <dev@…>, 17 years ago

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

by Thomas Güttler <hv@…>, 17 years ago

Attachment: views_debug_py.2.diff added

Better patch.

comment:2 by Adrian Holovaty, 17 years ago

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 by Adrian Holovaty, 17 years ago

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

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

Cc: hv@… added

comment:5 by Kevin McConnell, 16 years ago

Owner: changed from nobody to Kevin McConnell

by Kevin McConnell, 16 years ago

Attachment: views_debug_py.3.diff added

Show bold filenames where file in INSTALLED_APPS

comment:6 by Kevin McConnell, 16 years ago

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 by Malcolm Tredinnick, 16 years ago

milestone: post-1.0

comment:8 by Thomas Güttler, 16 years ago

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

by Thomas Güttler, 16 years ago

Attachment: views_debug_py.4.diff added

comment:9 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

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

Resolution: duplicate
Status: newclosed

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

comment:11 by Thomas Güttler, 12 years ago

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