aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticommon.lua
diff options
context:
space:
mode:
authoronefang2019-12-30 17:05:18 +1000
committeronefang2019-12-30 17:05:18 +1000
commitf02b222005f7d656a6da8d25dca5a5fef56857c2 (patch)
treed8746d182a6b11fd590d94199c31312d369c2996 /apt-panopticommon.lua
parentTODO++ (diff)
downloadapt-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.lua19
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
349end 349end
350 350
351APT.lnk = function(URL)
352 return '<a href="' .. URL .. '">' .. URL .. '</a>'
353end
354
355
351APT.search = function(t, s) 356APT.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
443end 448end
444APT.D = function(s) log(4, "DEBUG ", s) end 449APT.D = function(s, h) log(4, "DEBUG ", s, nil, nil, h) end
445APT.I = function(s) log(3, "INFO ", s) end 450APT.I = function(s, h) log(3, "INFO ", s, nil, nil, h) end
446APT.T = function(s, p, t, h) log(2, "TIMEOUT ", s, p, t, h) end 451APT.T = function(s, p, t, h) log(2, "TIMEOUT ", s, p, t, h) end
447APT.W = function(s, p, t, h) log(1, "WARNING ", s, p, t, h) end 452APT.W = function(s, p, t, h) log(1, "WARNING ", s, p, t, h) end
448APT.E = function(s, p, t, h) log(0, "ERROR ", s, p, t, h) end 453APT.E = function(s, p, t, h) log(0, "ERROR ", s, p, t, h) end
449APT.C = function(s) log(-1, "CRITICAL", s) end 454APT.C = function(s) log(-1, "CRITICAL", s) end
450local D = APT.D 455local D = APT.D
451local I = APT.I 456local I = APT.I
452local T = APT.T 457local 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