-
Notifications
You must be signed in to change notification settings - Fork 4
/
ess.py
29 lines (22 loc) · 950 Bytes
/
ess.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
ESS Starter
"""
import logging
import os
from logging.handlers import TimedRotatingFileHandler
from app import App
os.makedirs('log', exist_ok=True) # create paths if necessary
logging.basicConfig(level=logging.INFO,
format="%(asctime)s %(name)-12s %(levelname)-8s %(message)s",
datefmt='%Y-%m-%d %H:%M:%S',
handlers=[TimedRotatingFileHandler('log/log.txt', when='midnight'),
logging.StreamHandler()])
# specific logger configuration
# logging.getLogger('meterhub').setLevel(logging.DEBUG) # enable debug logging for a specific module
logging.getLogger('vebus').setLevel(logging.ERROR)
logging.getLogger('bms').setLevel(logging.ERROR)
# logging.getLogger('bms').setLevel(logging.DEBUG)
# logging.getLogger('bms').setLevel(logging.CRITICAL)
logging.getLogger('meterhub').setLevel(logging.ERROR)
app = App()
app.start() # start application mainloop