Changeset 157 for WingDBG/trunk/ZopeLogFile.py
- Timestamp:
- 08/04/06 22:31:45 (6 years ago)
- Files:
-
- 1 modified
-
WingDBG/trunk/ZopeLogFile.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
WingDBG/trunk/ZopeLogFile.py
r88 r157 28 28 29 29 All written information is collected until a newline is written after which the 30 collected line will be sent to the Zope Log.30 collected line will be sent to the logging module. 31 31 32 32 """ 33 33 34 from zLOG import * 34 import logging 35 35 36 36 class 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). 38 39 39 40 Data is collected and logged as summary lines whenever a newline is … … 43 44 44 45 """ 45 severity = INFO46 severity = logging.INFO 46 47 subsystem = '' 47 48 _data = '' 48 49 49 def __init__(self, subsystem, severity= INFO):50 def __init__(self, subsystem, severity=logging.INFO): 50 51 self.subsystem = subsystem 51 52 self.severity = severity … … 55 56 while '\n' in self._data: 56 57 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)
