From d5363aceeb231a73d940a084ec235d832f767b8f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 9 Oct 2013 20:04:20 +0200 Subject: [PATCH] get rid of __main__ hack --- libtuer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libtuer.py b/libtuer.py index e31ce27..e0898d5 100644 --- a/libtuer.py +++ b/libtuer.py @@ -3,15 +3,13 @@ import logging, logging.handlers, os, time, queue, threading, subprocess, multip # 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) -- 2.30.2