diff options
author | onefang | 2019-12-30 17:05:18 +1000 |
---|---|---|
committer | onefang | 2019-12-30 17:05:18 +1000 |
commit | f02b222005f7d656a6da8d25dca5a5fef56857c2 (patch) | |
tree | d8746d182a6b11fd590d94199c31312d369c2996 /apt-panopticommon.lua | |
parent | TODO++ (diff) | |
download | apt-panopticon-f02b222005f7d656a6da8d25dca5a5fef56857c2.zip apt-panopticon-f02b222005f7d656a6da8d25dca5a5fef56857c2.tar.gz apt-panopticon-f02b222005f7d656a6da8d25dca5a5fef56857c2.tar.bz2 apt-panopticon-f02b222005f7d656a6da8d25dca5a5fef56857c2.tar.xz |
A lot of tweaking of the logging and reporting, making it easier to read.
Diffstat (limited to 'apt-panopticommon.lua')
-rw-r--r-- | apt-panopticommon.lua | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index 4e75f3f..ca952d3 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua | |||
@@ -348,6 +348,11 @@ APT.allpairs = function(tbl, func) | |||
348 | end | 348 | end |
349 | end | 349 | end |
350 | 350 | ||
351 | APT.lnk = function(URL) | ||
352 | return '<a href="' .. URL .. '">' .. URL .. '</a>' | ||
353 | end | ||
354 | |||
355 | |||
351 | APT.search = function(t, s) | 356 | APT.search = function(t, s) |
352 | for i, v in pairs(t) do | 357 | for i, v in pairs(t) do |
353 | if v == s then return true end | 358 | if v == s then return true end |
@@ -441,12 +446,12 @@ local log = function(v, t, s, prot, test, host) | |||
441 | APT.logFile:flush() | 446 | APT.logFile:flush() |
442 | end | 447 | end |
443 | end | 448 | end |
444 | APT.D = function(s) log(4, "DEBUG ", s) end | 449 | APT.D = function(s, h) log(4, "DEBUG ", s, nil, nil, h) end |
445 | APT.I = function(s) log(3, "INFO ", s) end | 450 | APT.I = function(s, h) log(3, "INFO ", s, nil, nil, h) end |
446 | APT.T = function(s, p, t, h) log(2, "TIMEOUT ", s, p, t, h) end | 451 | APT.T = function(s, p, t, h) log(2, "TIMEOUT ", s, p, t, h) end |
447 | APT.W = function(s, p, t, h) log(1, "WARNING ", s, p, t, h) end | 452 | APT.W = function(s, p, t, h) log(1, "WARNING ", s, p, t, h) end |
448 | APT.E = function(s, p, t, h) log(0, "ERROR ", s, p, t, h) end | 453 | APT.E = function(s, p, t, h) log(0, "ERROR ", s, p, t, h) end |
449 | APT.C = function(s) log(-1, "CRITICAL", s) end | 454 | APT.C = function(s) log(-1, "CRITICAL", s) end |
450 | local D = APT.D | 455 | local D = APT.D |
451 | local I = APT.I | 456 | local I = APT.I |
452 | local T = APT.T | 457 | local T = APT.T |
@@ -463,7 +468,7 @@ APT.testing = function(t, host) | |||
463 | if t == v then | 468 | if t == v then |
464 | local h = APT.mirrors[host] | 469 | local h = APT.mirrors[host] |
465 | if nil == h then return true end | 470 | if nil == h then return true end |
466 | if true == h["Protocols"][t] then return true else D("Skipping " .. t .. " checks for " .. host) end | 471 | if true == h["Protocols"][t] then return true else I("Skipping " .. t .. " checks for " .. host) end |
467 | end | 472 | end |
468 | end | 473 | end |
469 | return false | 474 | return false |