diff --git a/boswatch.py b/boswatch.py index f47a0d5..7af76b6 100644 --- a/boswatch.py +++ b/boswatch.py @@ -23,7 +23,7 @@ import time #timestamp for doublealarm logger = logging.getLogger() logger.setLevel(logging.DEBUG) #set log string format -formatter = logging.Formatter('%(asctime)s - %(module)-15s [%(levelname)-8s] %(message)s', '%d.%m.%Y %H:%M:%S') +formatter = logging.Formatter('%(asctime)s - %(module)-12s [%(levelname)-8s] %(message)s', '%d.%m.%Y %H:%M:%S') #create a file logger fh = logging.FileHandler('log/boswatch.log', 'w') fh.setLevel(logging.DEBUG) #log level >= Debug diff --git a/plugins/template/template.py b/plugins/template/template.py index 9b2ec3a..5b70cba 100644 --- a/plugins/template/template.py +++ b/plugins/template/template.py @@ -4,6 +4,25 @@ import logging # Global logger import globals # Global variables +######### +# USAGE +# +# Config +# ====== +# to read a option from config File +# VALUE = globals.config.get("SECTION", "OPTION") +# +# Data from boswatch.py +# ===================== +# use data["KEY"] for Alarm Data from boswatch.py +# for usable KEYs in different Functions (FMS|ZVEI|POC) see interface.txt +# +# LOG Messages +# ============ +# send Log Messages with logging.LOGLEVEL("MESSAGE") +# usable Loglevels debug|info|warning|error|exception|critical +# if you use .exception in Try:Exception: Construct, it logs the Python EX.message too + def run(typ,freq,data): try: #ConfigParser