mirror of
https://github.com/pommi/python-itho-wpu.git
synced 2024-11-22 14:02:15 +01:00
fix(itho_i2c): make loglevel in itho_i2c module adjustable
This commit is contained in:
parent
7a1140e26c
commit
1ffd5a72d7
@ -434,6 +434,7 @@ def main():
|
|||||||
|
|
||||||
if args.loglevel:
|
if args.loglevel:
|
||||||
logger.setLevel(args.loglevel.upper())
|
logger.setLevel(args.loglevel.upper())
|
||||||
|
logging.getLogger("itho_i2c").setLevel(args.loglevel.upper())
|
||||||
|
|
||||||
if args.timestamp:
|
if args.timestamp:
|
||||||
stdout_log_handler.setFormatter(
|
stdout_log_handler.setFormatter(
|
||||||
|
@ -4,8 +4,13 @@ import logging
|
|||||||
import pigpio
|
import pigpio
|
||||||
import struct
|
import struct
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
logger.setLevel(logging.INFO)
|
||||||
|
stdout_log_handler = logging.StreamHandler(sys.stdout)
|
||||||
|
stdout_log_handler.setFormatter(logging.Formatter("%(message)s"))
|
||||||
|
logger.addHandler(stdout_log_handler)
|
||||||
|
|
||||||
actions = {
|
actions = {
|
||||||
"getnodeid": [0x90, 0xE0],
|
"getnodeid": [0x90, 0xE0],
|
||||||
|
Loading…
Reference in New Issue
Block a user