Add timestamp in function outputs

This commit is contained in:
Henri DF
2016-03-29 19:54:15 -07:00
parent 97d7b125ba
commit 38957d3b14
2 changed files with 4 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ local mod = {}
function mod.syslog(evt, level, format)
nixio = require("nixio")
format = "%evt.time: "..format
formatter = digwatch.formatter(format)
msg = digwatch.format_event(evt, formatter)
nixio.syslog(level, msg)
@@ -14,6 +15,8 @@ function mod.first_sequence(evt, fieldname, key, format)
local field_value = digwatch.field(evt, fieldname)
local now = os.time()
format = "%evt.time: "..format
if first_sequence_state[key] == nil then
first_sequence_state[key] = {}
end