Pārlūkot izejas kodu

log level added to config

tags/v1.3.0
Dirk Alders 1 gadu atpakaļ
vecāks
revīzija
ae0ae97b5c
2 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 4
    1
      config_example/config.py
  2. 1
    1
      smart_brain.py

+ 4
- 1
config_example/config.py Parādīt failu

@@ -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 Parādīt failu

@@ -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

Notiek ielāde…
Atcelt
Saglabāt