projects
/
saartuer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
189386b
)
get rid of __main__ hack
author
Ralf Jung
<post@ralfj.de>
Wed, 9 Oct 2013 18:04:20 +0000
(20:04 +0200)
committer
Ralf Jung
<post@ralfj.de>
Wed, 9 Oct 2013 18:04:20 +0000
(20:04 +0200)
libtuer.py
patch
|
blob
|
history
diff --git
a/libtuer.py
b/libtuer.py
index e31ce2728497f1c2dab8bfadad7d3b7a153ec41c..e0898d580696045c53eacb5a6dc0aed8bf91d0f7 100644
(file)
--- 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):
# 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):
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)
print (thestr)
self.logger.log(lvl, thestr)