Ticket #1089 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

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

sugar-base-trace.patch Download (3.5 KB) - added by sascha_silbe 4 years ago.
sugar.logger: add decorator trace() and log level 'trace' / TRACE

Change History

Changed 4 years ago by sascha_silbe

sugar.logger: add decorator trace() and log level 'trace' / TRACE

Changed 4 years ago by sascha_silbe

  • keywords r? added

Changed 4 years ago by tomeu

  • keywords r+ added; r? removed
  • status changed from new to closed
  • resolution set to fixed

pushed, thanks!

Note: See TracTickets for help on using tickets.