Changes

Jump to navigation Jump to search
_logger.setLevel(logging.DEBUG)
Line 1: Line 1: −
{{Sugar Almanac TOC}}
+
{{Almanac}}
 +
 
 
=== What is the overall structure of python standard logging that I will use in Sugar? ===
 
=== What is the overall structure of python standard logging that I will use in Sugar? ===
    
Sugar uses Python's Standard Logging<ref>[http://www.onlamp.com/pub/a/python/2005/06/02/logging.html OnLamp.com-- Python Standard Logging]</ref><ref>Python Library Reference -- [http://docs.python.org/lib/module-logging.html Logging]</ref> pretty much without modification. The diagram below conceptualizes how logging generally works.  
 
Sugar uses Python's Standard Logging<ref>[http://www.onlamp.com/pub/a/python/2005/06/02/logging.html OnLamp.com-- Python Standard Logging]</ref><ref>Python Library Reference -- [http://docs.python.org/lib/module-logging.html Logging]</ref> pretty much without modification. The diagram below conceptualizes how logging generally works.  
 +
 +
[[Image: Logging-Sugar-Almanac.jpg | Logging Diagram for Python]]
    
=== How do I write to a log in my activity code? ===
 
=== How do I write to a log in my activity code? ===
Line 9: Line 12:  
     import logging
 
     import logging
 
     _logger = logging.getLogger('annotate-activity')
 
     _logger = logging.getLogger('annotate-activity')
 +
    _logger.setLevel(logging.DEBUG)
 +
 
     ...
 
     ...
 
         _logger.debug('starting activity')
 
         _logger.debug('starting activity')
Line 21: Line 26:  
import logging.config
 
import logging.config
 
_logger = logging.getLogger('activity-annotate')
 
_logger = logging.getLogger('activity-annotate')
 +
_logger.setLevel(logging.DEBUG)
 
...
 
...
 
     #### Method: __init__, initialize this AnnotateActivity instance
 
     #### Method: __init__, initialize this AnnotateActivity instance

Navigation menu