X-Git-Url: https://git.ralfj.de/saartuer.git/blobdiff_plain/19a7c2977daef47da6ad1bc0ca73010921f5122d..72033b3361e5f60ae1e0086f9326d815e4cec845:/libtuer.py diff --git a/libtuer.py b/libtuer.py index 5b1221c..1f8a034 100644 --- a/libtuer.py +++ b/libtuer.py @@ -3,15 +3,13 @@ import logging, logging.handlers, os, time, queue, threading, subprocess # 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)