Package AccessEngine :: Module AELog :: Class PrintLogger
[hide private]
[frames] | no frames]

Class PrintLogger

source code

object --+
         |
        PrintLogger

Provides a dirt-simple interface compatible with stdout and stderr. When assigned to sys.stdout or sys.stderr, an instance of this class redirects print statements to the logging system. This means the result of the print statements can be silenced, sent to a file, etc. using the command line options to SUE. The log level used is defined by the LEVEL constant in this class.

Instance Methods [hide private]
 
__init__(self)
Create the logger.
source code
 
write(self, data)
Write the given data at the debug level to the logger.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
integer LEVEL = 15
Logging level for writes directed through this class, above DEBUG and below INFO
Instance Variables [hide private]
logging.Logger log
Reference to the Print log channel
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Create the logger.
Overrides: object.__init__

write(self, data)

source code 
Write the given data at the debug level to the logger. Stores chunks of text until a new line is encountered, then sends to the logger.
Parameters:
  • data (stringable) - Any object that can be converted to a string