Development Team/Almanac/Python Standard Logging
< Development Team | Almanac
Revision as of 10:53, 9 July 2008 by 18.85.47.87 (talk)
What is the overall structure of python standard logging that I will use in Sugar?
Sugar uses Python's Standard Logging[1][2] pretty much without modification. The diagram below conceptualizes how logging generally works.
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. The log message will be written to the standard log output destination (usually the console).
import logging _logger = logging.getLogger('annotate-activity') ... _logger.debug('starting activity')
Notes
- ↑ OnLamp.com-- Python Standard Logging
- ↑ Python Library Reference -- Logging