Skip to content

Commit

Permalink
agent: update timestamp format
Browse files Browse the repository at this point in the history
Signed-off-by: He Xian <[email protected]>
  • Loading branch information
hexian000 committed Nov 10, 2024
1 parent f45d19b commit 3a8f374
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion agent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ function agent.stats(dt)
local w = list:new()
for peername, data in pairs(_G.peerdb) do
local tag = strformat("%q", peername)
local timestamp = os.date("%Y-%m-%dT%T%z", data.timestamp)
local timestamp = format_timestamp(data.timestamp)
local connid, conn, info = peers[peername], nil, nil
if connid then conn = _G.conninfo[connid] end
if conn then info = conn[peername] end
Expand Down
1 change: 1 addition & 0 deletions libruleset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ local function format_timestamp(t)
local s = os.date("%Y-%m-%dT%T%z", t)
return s:sub(1, -3) .. ":" .. s:sub(-2, -1)
end
_G.format_timestamp = format_timestamp

local function log_(now, info, msg)
if config.loglevel < 6 then
Expand Down

0 comments on commit 3a8f374

Please sign in to comment.