Skip to content

Commit

Permalink
updated logging
Browse files Browse the repository at this point in the history
  • Loading branch information
britkat1980 committed Feb 2, 2022
1 parent 8a48f0e commit a6bdf19
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ givenergy-modbus
scapy
schedule
influxdb_client
requests
requests
flask
4 changes: 2 additions & 2 deletions src/GivJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/influx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a6bdf19

Please sign in to comment.