Changeset 1493 for pykota/trunk/pykota/loggers
- Timestamp:
- 05/24/04 13:59:51 (20 years ago)
- Location:
- pykota/trunk/pykota/loggers
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/loggers/stderr.py
r1457 r1493 22 22 # 23 23 # $Log$ 24 # Revision 1.7 2004/05/24 11:59:49 jalet 25 # More robust (?) code 26 # 24 27 # Revision 1.6 2004/05/07 14:43:44 jalet 25 28 # Now logs the PID too … … 52 55 def log_message(self, message, level="info") : 53 56 """Sends the message to the appropriate logging subsystem.""" 54 sys.stderr.write("%s: PyKota (PID %s) : %s\n" % (level.upper(), os.getpid(), message.strip())) 55 sys.stderr.flush() 57 try : 58 sys.stderr.write("%s: PyKota (PID %s) : %s\n" % (level.upper(), os.getpid(), message.strip())) 59 except IOError : 60 pass # What else could we do ? 61 else : 62 try : 63 sys.stderr.flush() 64 except IOError : 65 pass # What else could we do ? -
pykota/trunk/pykota/loggers/system.py
r1457 r1493 22 22 # 23 23 # $Log$ 24 # Revision 1.11 2004/05/24 11:59:51 jalet 25 # More robust (?) code 26 # 24 27 # Revision 1.10 2004/05/07 14:43:46 jalet 25 28 # Now logs the PID too … … 74 77 """Sends the message to syslog.""" 75 78 priority = getattr(syslog, "LOG_%s" % self.levels.get(level.lower(), "DEBUG").upper(), syslog.LOG_DEBUG) 76 syslog.syslog(priority, "(PID %s) : %s" % (os.getpid(), message.strip())) 79 try : 80 syslog.syslog(priority, "(PID %s) : %s" % (os.getpid(), message.strip())) 81 except : 82 pass # What else could we do ?