Add Object.py and log.py

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-07-30 18:51:19 +02:00
commit 36aac73b5d
3 changed files with 41 additions and 1 deletions

View file

@ -0,0 +1,22 @@
import syslog
EMERG = syslog.LOG_EMERG
ALER = syslog.LOG_ALERT
CRIT = syslog.LOG_CRIT
ERR = syslog.LOG_ERR
WARNING = syslog.LOG_WARNING
NOTICE = syslog.LOG_NOTICE
INFO = syslog.LOG_INFO
DEBUG = syslog.LOG_DEBUG
DEVEL = syslog.LOG_DEBUG + 1
OFF = DEVEL + 1
level = NOTICE
def log(prio, *args): # export
if prio <= level:
msg = ""
for count, thing in enumerate(args):
msg += ' ' + str(thing)
if len(msg):
print msg[1:]