Changeset 825 for pykota/trunk/pykota
- Timestamp:
- 02/28/03 00:48:41 (21 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/loggers/system.py
r824 r825 15 15 # 16 16 # $Log$ 17 # Revision 1.4 2003/02/27 23:48:41 jalet 18 # Correctly maps PyKota's log levels to syslog log levels 19 # 17 20 # Revision 1.3 2003/02/27 22:55:20 jalet 18 21 # WARN log priority doesn't exist. … … 32 35 class Logger : 33 36 """A logger class which logs to syslog.""" 37 levels = { "error" : "ERR", "warn": "WARNING", "info": "INFO", "debug": "DEBUG" } 34 38 def __init__(self) : 35 39 """Opens the logging subsystem.""" … … 42 46 def log_message(self, message, level="info") : 43 47 """Sends the message to syslog.""" 44 priority = getattr(syslog, "LOG_%s" % level.upper(), syslog.LOG_DEBUG)48 priority = getattr(syslog, "LOG_%s" % self.levels.get(level.lower(), "DEBUG").upper(), syslog.LOG_DEBUG) 45 49 syslog.syslog(priority, message) -
pykota/trunk/pykota/tool.py
r824 r825 15 15 # 16 16 # $Log$ 17 # Revision 1.24 2003/02/27 23:48:41 jalet 18 # Correctly maps PyKota's log levels to syslog log levels 19 # 17 20 # Revision 1.23 2003/02/27 22:55:20 jalet 18 21 # WARN log priority doesn't exist. … … 254 257 else : 255 258 action = "DENY" 256 self.logger.log_message(_("Unable to match user %s on printer %s, applying default policy (%s)") % (username, printername, action) , "info")259 self.logger.log_message(_("Unable to match user %s on printer %s, applying default policy (%s)") % (username, printername, action)) 257 260 return (action, None, None) 258 261 else :