#222 added debug log enable to configs

This commit is contained in:
Mikayla
2023-05-10 20:57:23 +00:00
parent 032284e90d
commit 50c0a4a3eb
11 changed files with 47 additions and 32 deletions

View File

@@ -17,6 +17,8 @@ config.LOG_PATH = "/log.txt"
-- 0 = APPEND (adds to existing file on start)
-- 1 = NEW (replaces existing file on start)
config.LOG_MODE = 0
-- true to log verbose debug messages
config.LOG_DEBUG = false
-- RTU peripheral devices (named: side/network device name)
config.RTU_DEVICES = {

View File

@@ -49,6 +49,7 @@ cfv.assert_type_num(config.COMMS_TIMEOUT)
cfv.assert_min(config.COMMS_TIMEOUT, 2)
cfv.assert_type_str(config.LOG_PATH)
cfv.assert_type_int(config.LOG_MODE)
cfv.assert_type_bool(config.LOG_DEBUG)
cfv.assert_type_table(config.RTU_DEVICES)
cfv.assert_type_table(config.RTU_REDSTONE)
assert(cfv.valid(), "bad config file: missing/invalid fields")
@@ -57,7 +58,7 @@ assert(cfv.valid(), "bad config file: missing/invalid fields")
-- log init
----------------------------------------
log.init(config.LOG_PATH, config.LOG_MODE)
log.init(config.LOG_PATH, config.LOG_MODE, config.LOG_DEBUG)
log.info("========================================")
log.info("BOOTING rtu.startup " .. RTU_VERSION)