Python Standard Logging in Sugar

From OLPC
Revision as of 15:35, 3 July 2008 by Fanwar (talk | contribs) (New page: === How do I write to a log in my activity code? === Sugar uses [http://www.onlamp.com/pub/a/python/2005/06/02/logging.html python's standard logging]. The following code shows how to outp...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

How do I write to a log in my activity code?

Sugar uses python's standard logging. The following code shows how to output something at the debug log level.

   import logging
   _logger = logging.getLogger('annotate-activity')
   ...
        _logger.debug('starting activity')