[Bugs] #1889 HIGH: Print stack when encountering an exception during log formatting
Sugar Labs Bugs
bugtracker-noreply at sugarlabs.org
Tue May 25 15:42:27 EDT 2010
#1889: Print stack when encountering an exception during log formatting
-----------------------------+----------------------------------------------
Reporter: sascha_silbe | Owner: sascha_silbe
Type: enhancement | Status: new
Priority: High | Milestone: 0.88.x
Component: sugar | Version: Git as of bugdate
Severity: Blocker | Keywords: r+
Distribution: Unspecified | Status_field: Assigned
-----------------------------+----------------------------------------------
Comment(by sascha_silbe):
Replying to [comment:4 tomeu]:
> Thanks, though would be great if we could remove the logging-specific
lines from the traceback.
I just looked into that, but don't consider it useful because:
1. print_exception():
We could print the exception as a simple string instead of as a
traceback, but I think that would make it harder to understand what's
going on. Compare
{{{
Traceback (most recent call last):
File "/usr/lib/python2.5/logging/__init__.py", line 744, in emit
msg = self.format(record)
File "/usr/lib/python2.5/logging/__init__.py", line 630, in format
return fmt.format(record)
File "/usr/lib/python2.5/logging/__init__.py", line 418, in format
record.message = record.getMessage()
File "/usr/lib/python2.5/logging/__init__.py", line 288, in
getMessage
msg = msg % self.args
TypeError: int argument required
}}}
with
{{{
Exception in log handler: int argument required
}}}
2. print_stack():
We could apply some magic to remove the last 8 entries from the
traceback, but it would be somewhat complex and potentially fragile. Given
that exceptions in log handlers are rare, I'd rather apply KISS than trim
a few unnecessary lines.
--
Ticket URL: <http://bugs.sugarlabs.org/ticket/1889#comment:5>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list