# logging function
class Logger:
def __init__ (self):
- import __main__ as main
- self.name = os.path.basename(main.__file__)
- self.logger = logging.getLogger(self.name)
+ self.logger = logging.getLogger("tuerd")
self.logger.setLevel(logging.INFO)
self.handler = logging.handlers.SysLogHandler(address = '/dev/log', facility = logging.handlers.SysLogHandler.LOG_LOCAL0)
self.logger.addHandler(self.handler)
def log (self, lvl, what):
- thestr = "%s[%d]: %s" % (self.name,os.getpid(),what)
+ thestr = "%s[%d]: %s" % ("osspd", os.getpid(), what)
print (thestr)
self.logger.log(lvl, thestr)