diff options
author | onefang | 2019-12-25 23:10:15 +1000 |
---|---|---|
committer | onefang | 2019-12-25 23:10:15 +1000 |
commit | 18dd54b8f0ba73abd84397977712926d3491f088 (patch) | |
tree | 549c82469bc0873f502d1e074ee709a8ae9c9d5c /apt-panopticommon.lua | |
parent | Track, store, and report info from the hosts that get redirected to. (diff) | |
download | apt-panopticon-18dd54b8f0ba73abd84397977712926d3491f088.zip apt-panopticon-18dd54b8f0ba73abd84397977712926d3491f088.tar.gz apt-panopticon-18dd54b8f0ba73abd84397977712926d3491f088.tar.bz2 apt-panopticon-18dd54b8f0ba73abd84397977712926d3491f088.tar.xz |
Use proper time and date format, and check for the directory before tarballing it up.
Diffstat (limited to 'apt-panopticommon.lua')
-rw-r--r-- | apt-panopticommon.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index 37b43e4..55f0e40 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua | |||
@@ -378,7 +378,7 @@ local log = function(v, t, s, prot, test, host) | |||
378 | end | 378 | end |
379 | end | 379 | end |
380 | if v <= APT.verbosity then | 380 | if v <= APT.verbosity then |
381 | if 3 <= APT.verbosity then t = os.date() .. " " .. t end | 381 | if 3 <= APT.verbosity then t = os.date('!%F %T') .. " " .. t end |
382 | print(t .. ": " .. s) | 382 | print(t .. ": " .. s) |
383 | end | 383 | end |
384 | if nil ~= APT.logFile then | 384 | if nil ~= APT.logFile then |
@@ -390,9 +390,9 @@ local log = function(v, t, s, prot, test, host) | |||
390 | if 2 == v then colour = "blue " end -- TIMEOUT | 390 | if 2 == v then colour = "blue " end -- TIMEOUT |
391 | if 3 == v then colour = "white " end -- INFO | 391 | if 3 == v then colour = "white " end -- INFO |
392 | if 4 == v then colour = "gray " end -- DEBUG | 392 | if 4 == v then colour = "gray " end -- DEBUG |
393 | APT.logFile:write(os.date() .. " <font color='" .. colour .. "'><b>" .. t .. "</b></font>: " .. s .. "</br>\n") | 393 | APT.logFile:write(os.date('!%F %T') .. " <font color='" .. colour .. "'><b>" .. t .. "</b></font>: " .. s .. "</br>\n") |
394 | else | 394 | else |
395 | APT.logFile:write(os.date() .. " " .. t .. ": " .. s .. "\n") | 395 | APT.logFile:write(os.date('!%F %T') .. " " .. t .. ": " .. s .. "\n") |
396 | end | 396 | end |
397 | APT.logFile:flush() | 397 | APT.logFile:flush() |
398 | end | 398 | end |