Python Standard Logging in Sugar

From OLPC
Revision as of 19: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 Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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')