Ticket #1089 (closed enhancement: fixed)
sugar.logger: add trace decorator
| Reported by: | sascha_silbe | Owned by: | tomeu |
|---|---|---|---|
| Priority: | Unspecified by Maintainer | Milestone: | 0.86 |
| Component: | sugar | Version: | Git as of bugdate |
| Severity: | Unspecified | Keywords: | r+ |
| Cc: | Distribution/OS: | Unspecified | |
| Bug Status: | New |
Description
The attached patch adds a trace decorator to sugar.logger. It can be used to trace function calls and limits the size of the items it logs. This way e.g. the "preview" attribute (metadata) will be shortened automatically.
It will only trace calls if the new log level TRACE is in effect, which can be done by setting SUGAR_LOGGER_LEVEL to one of the new values 'trace' (lower than 'debug', i.e. 'debug' will be enabled as well) or 'all' (log everything).
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

