Use logging and coloredlogs instead of printing

This commit is contained in:
April
2022-10-17 22:17:38 -07:00
parent 7a32af77aa
commit ec9268deae
12 changed files with 193 additions and 72 deletions

View File

@ -5,6 +5,7 @@ import uuid
import os
import shutil
import xml.dom.minidom
import logging,coloredlogs
import sys
sys.path.append("./py2lib")
@ -14,6 +15,8 @@ import bit
import MachineProductCfg as MPC
import LFRecord as LFR
l = logging.getLogger(__name__)
coloredlogs.install()
tecciId = []
zipCodes = []
@ -37,7 +40,7 @@ def getData(tecci, zipCode):
newData = data[67:-30]
print('[CURRENT CONDITIONS] Gathering data for location id ' + tecci)
l.debug('Gathering data for location id ' + tecci)
#Write to .i2m file
i2Doc = '<CurrentObservations id="000000000" locationKey="' + str(tecci) + '" isWxscan="0">' + '' + newData + '<clientKey>' + str(tecci) + '</clientKey></CurrentObservations>'
@ -47,6 +50,7 @@ def getData(tecci, zipCode):
f.close()
def makeDataFile():
l.info("Writing a CurrentObservations record.")
header = '<Data type="CurrentObservations">'
footer = '</Data>'