From f02b222005f7d656a6da8d25dca5a5fef56857c2 Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 30 Dec 2019 17:05:18 +1000 Subject: A lot of tweaking of the logging and reporting, making it easier to read. --- apt-panopticommon.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'apt-panopticommon.lua') 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) end end +APT.lnk = function(URL) + return '' .. URL .. '' +end + + APT.search = function(t, s) for i, v in pairs(t) do if v == s then return true end @@ -441,12 +446,12 @@ local log = function(v, t, s, prot, test, host) APT.logFile:flush() end end -APT.D = function(s) log(4, "DEBUG ", s) end -APT.I = function(s) log(3, "INFO ", s) end -APT.T = function(s, p, t, h) log(2, "TIMEOUT ", s, p, t, h) end -APT.W = function(s, p, t, h) log(1, "WARNING ", s, p, t, h) end -APT.E = function(s, p, t, h) log(0, "ERROR ", s, p, t, h) end -APT.C = function(s) log(-1, "CRITICAL", s) end +APT.D = function(s, h) log(4, "DEBUG ", s, nil, nil, h) end +APT.I = function(s, h) log(3, "INFO ", s, nil, nil, h) end +APT.T = function(s, p, t, h) log(2, "TIMEOUT ", s, p, t, h) end +APT.W = function(s, p, t, h) log(1, "WARNING ", s, p, t, h) end +APT.E = function(s, p, t, h) log(0, "ERROR ", s, p, t, h) end +APT.C = function(s) log(-1, "CRITICAL", s) end local D = APT.D local I = APT.I local T = APT.T @@ -463,7 +468,7 @@ APT.testing = function(t, host) if t == v then local h = APT.mirrors[host] if nil == h then return true end - if true == h["Protocols"][t] then return true else D("Skipping " .. t .. " checks for " .. host) end + if true == h["Protocols"][t] then return true else I("Skipping " .. t .. " checks for " .. host) end end end return false -- cgit v1.1