1 import logging, logging.handlers, syslog, os
6 import __main__ as main
7 self.name = os.path.basename(main.__file__)
8 self.logger = logging.getLogger(self.name)
9 self.logger.setLevel(logging.INFO)
10 self.handler = logging.handlers.SysLogHandler(address = '/dev/log', facility = logging.handlers.SysLogHandler.LOG_LOCAL0)
11 self.logger.addHandler(self.handler)
13 thestr = "%s[%d]: %s" % (self.name,os.getpid(),what)
15 self.logger.info(thestr)