Show
Ignore:
Timestamp:
08/04/06 22:31:45 (6 years ago)
Author:
mj
Message:

Use the logging module; zLOG has been deprecated

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • WingDBG/trunk/ZopeLogFile.py

    r88 r157  
    2828 
    2929All written information is collected until a newline is written after which the 
    30 collected line will be sent to the Zope Log. 
     30collected line will be sent to the logging module. 
    3131 
    3232""" 
    3333 
    34 from zLOG import * 
     34import logging 
    3535 
    3636class ZopeLogFile: 
    37     """File-like object that sends all data written to it to the Zope eventlog 
     37    """File-like object that sends all data written to it to the logging module 
     38    (which zope will have handlers configured for). 
    3839     
    3940    Data is collected and logged as summary lines whenever a newline is  
     
    4344     
    4445    """ 
    45     severity = INFO 
     46    severity = logging.INFO 
    4647    subsystem = '' 
    4748    _data = '' 
    4849     
    49     def __init__(self, subsystem, severity=INFO): 
     50    def __init__(self, subsystem, severity=logging.INFO): 
    5051        self.subsystem = subsystem 
    5152        self.severity = severity 
     
    5556        while '\n' in self._data: 
    5657            line, self._data = self._data.split('\n', 1) 
    57             LOG(self.subsystem, self.severity, line) 
     58            logger = logging.getLogger(self.subsystem) 
     59            logger.log(self.severity, line)