Browse Source

log level added to config

tags/v1.3.0
Dirk Alders 1 year ago
parent
commit
ae0ae97b5c
2 changed files with 5 additions and 2 deletions
  1. 4
    1
      config_example/config.py
  2. 1
    1
      smart_brain.py

+ 4
- 1
config_example/config.py View File

@@ -1,8 +1,11 @@
1 1
 import geo
2
+import logging
2 3
 import report
3 4
 from topics import *
4 5
 
5
-DEBUG = False
6
+DEBUG = False   # False: logging to stdout with given LOGLEVEL  - True: logging all to localhost:19996 and warnings or higher to stdout
7
+LOGLEVEL = logging.INFO
8
+
6 9
 GEO_POSITION = geo.gps.coordinate(lat=49.519167, lon=9.3672222)
7 10
 
8 11
 APP_NAME = "smart_brain"

+ 1
- 1
smart_brain.py View File

@@ -46,7 +46,7 @@ if __name__ == "__main__":
46 46
         report.appLoggingConfigure(None, 'stdout', ((config.APP_NAME, logging.DEBUG), ),
47 47
                                    target_level=logging.WARNING, fmt=report.SHORT_FMT, host='localhost', port=19996)
48 48
     else:
49
-        report.stdoutLoggingConfigure(((config.APP_NAME, logging.WARNING), ), report.SHORT_FMT)
49
+        report.stdoutLoggingConfigure(((config.APP_NAME, config.LOGLEVEL), ), report.SHORT_FMT)
50 50
 
51 51
     #
52 52
     # MQTT Client

Loading…
Cancel
Save