little changes in template modul

This commit is contained in:
Bastian Schroll 2015-05-18 22:10:23 +02:00
parent 2b2f8c54e6
commit 367e68e5fe
2 changed files with 7 additions and 6 deletions

View file

@ -25,7 +25,7 @@ logger.addHandler(fh)
#create a display loger
ch = logging.StreamHandler()
ch.setLevel(logging.ERROR) #log level >= Error
ch.setLevel(logging.INFO) #log level >= info
ch.setFormatter(formatter)
logger.addHandler(ch)
@ -33,7 +33,7 @@ logger.addHandler(ch)
#log levels
#----------
#debug - debug messages only for log
#info - inormation for normal display
#info - information for normal display
#warning
#error - normal error - program goes further
#exception - error with exception message in log

View file

@ -5,7 +5,8 @@ import logging # Global logger
import globals # Global variables
def run(typ,freq,data):
try:
logging.info("ZVEI: %s wurde auf %s empfangen!", data["zvei"],freq)
except:
logging.exception("Error in Template Plugin")
try:
if typ == "ZVEI":
logging.info("ZVEI: %s wurde auf %s empfangen!", data["zvei"],freq)
except:
logging.exception("Error in Template Plugin")