Implemented logging
This commit is contained in:
parent
3e930c04a9
commit
5a6663c369
7 changed files with 123 additions and 7 deletions
9
logger.py
Normal file
9
logger.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import time
|
||||
|
||||
|
||||
def logwriter(val, logpath, warn):
|
||||
with open(logpath, "a") as logfile:
|
||||
if not warn:
|
||||
logfile.write("{}: Value was {}\n".format(time.time(), val))
|
||||
else:
|
||||
logfile.write("{}: WARNING! Value was {}, too high\n".format(time.time(), val))
|
||||
Loading…
Add table
Add a link
Reference in a new issue