Opened 8 years ago

Closed 6 years ago

Last modified 4 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
Component: Core (Other) Version: master
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@…> 8 years ago.
views_debug_py.2.diff (1.4 KB) - added by Thomas Güttler <hv@…> 8 years ago.
Better patch.
views_debug_py.3.diff (2.4 KB) - added by kevin 7 years ago.
Show bold filenames where file in INSTALLED_APPS
views_debug_py.4.diff (3.7 KB) - added by guettli 7 years ago.

Download all attachments as: .zip

Change History (15)

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

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

  • Component changed from Uncategorized to Metasystem
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from jacob to adrian
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

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

Better patch.

comment:2 Changed 8 years ago by adrian

  • Has patch set
  • Patch needs improvement set
  • Triage Stage changed from Design decision needed to Accepted

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 8 years ago by adrian

  • Component changed from Metasystem to Core framework
  • Summary changed from debug template: Display my files bigger to Debug page traceback should highlight local code vs. framework code

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

  • Cc hv@… added

comment:5 Changed 7 years ago by kevin

  • Owner changed from nobody to kevin

Changed 7 years ago by kevin

Show bold filenames where file in INSTALLED_APPS

comment:6 Changed 7 years ago by kevin

  • 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 7 years ago by mtredinnick

  • milestone set to post-1.0

comment:8 Changed 7 years ago by guettli

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 7 years ago by guettli

comment:9 Changed 6 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:10 Changed 6 years ago by guettli

  • Resolution set to duplicate
  • Status changed from new to closed

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

comment:11 Changed 4 years ago by guettli

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