From a6bdf19c69508cb78d2deece0979d4526af43046 Mon Sep 17 00:00:00 2001 From: britkat Date: Wed, 2 Feb 2022 13:00:47 +0000 Subject: [PATCH] updated logging --- requirements.txt | 3 ++- src/GivJson.py | 4 ++-- src/influx.py | 4 ++-- src/mqtt.py | 4 ++-- src/read.py | 4 ++-- src/write.py | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/requirements.txt b/requirements.txt index 54f8ee90..ba29f0d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ givenergy-modbus scapy schedule influxdb_client -requests \ No newline at end of file +requests +flask \ No newline at end of file diff --git a/src/GivJson.py b/src/GivJson.py index 7af5fff2..64e6f5a8 100644 --- a/src/GivJson.py +++ b/src/GivJson.py @@ -3,12 +3,12 @@ import logging from settings import GiV_Settings -if GiV_Settings.log_level.lower()=="debug": +if GiV_Settings.Log_Level.lower()=="debug": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(filename=GiV_Settings.Debug_File_Location, encoding='utf-8', level=logging.DEBUG) -elif GiV_Settings.log_level.lower()=="info": +elif GiV_Settings.Log_Level.lower()=="info": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.INFO) else: diff --git a/src/influx.py b/src/influx.py index 44db20a2..3a76bf25 100644 --- a/src/influx.py +++ b/src/influx.py @@ -3,12 +3,12 @@ import logging from settings import GiV_Settings -if GiV_Settings.log_level.lower()=="debug": +if GiV_Settings.Log_Level.lower()=="debug": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(filename=GiV_Settings.Debug_File_Location, encoding='utf-8', level=logging.DEBUG) -elif GiV_Settings.log_level.lower()=="info": +elif GiV_Settings.Log_Level.lower()=="info": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.INFO) else: diff --git a/src/mqtt.py b/src/mqtt.py index 6581c9a0..54d57998 100644 --- a/src/mqtt.py +++ b/src/mqtt.py @@ -8,12 +8,12 @@ from settings import GiV_Settings from givenergy_modbus.model.inverter import Model -if GiV_Settings.log_level.lower()=="debug": +if GiV_Settings.Log_Level.lower()=="debug": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(filename=GiV_Settings.Debug_File_Location, encoding='utf-8', level=logging.DEBUG) -elif GiV_Settings.log_level.lower()=="info": +elif GiV_Settings.Log_Level.lower()=="info": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.INFO) else: diff --git a/src/read.py b/src/read.py index a08e8031..3d8ccc4c 100644 --- a/src/read.py +++ b/src/read.py @@ -15,12 +15,12 @@ if GiV_Settings.Print_Raw_Registers.lower()=="true": Print_Raw=True -if GiV_Settings.log_level.lower()=="debug": +if GiV_Settings.Log_Level.lower()=="debug": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(filename=GiV_Settings.Debug_File_Location, encoding='utf-8', level=logging.DEBUG) -elif GiV_Settings.log_level.lower()=="info": +elif GiV_Settings.Log_Level.lower()=="info": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.INFO) else: diff --git a/src/write.py b/src/write.py index bed93468..516e82b5 100644 --- a/src/write.py +++ b/src/write.py @@ -7,12 +7,12 @@ from settings import GiV_Settings from givenergy_modbus.client import GivEnergyClient -if GiV_Settings.log_level.lower()=="debug": +if GiV_Settings.Log_Level.lower()=="debug": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(filename=GiV_Settings.Debug_File_Location, encoding='utf-8', level=logging.DEBUG) -elif GiV_Settings.log_level.lower()=="info": +elif GiV_Settings.Log_Level.lower()=="info": if GiV_Settings.Debug_File_Location=="": logging.basicConfig(level=logging.INFO) else: