From 7dccd1610618ccea2567afa38fa91eec11cbf432 Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 23 Dec 2019 13:06:44 +1000 Subject: Promote verbosity to become an externally visible entity. --- apt-panopticommon.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index 4b0be8b..ef622b1 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -6,7 +6,7 @@ APT.rrd = require 'rrd' APT.protocols = {"ftp", "http", "https", "rsync"} APT.tests = {'raw', 'Integrity', 'Protocol', 'Updated', 'URLSanity', 'Speed'} -verbosity = -1 +APT.verbosity = -1 APT.origin = false APT.keep = false @@ -92,10 +92,10 @@ APT.parseArgs = function(args) elseif "--version" == a then print("apt-panopticon version 0.1 WIP development version") elseif "-v" == a then - verbosity = verbosity + 1 + APT.verbosity = APT.verbosity + 1 sendArgs = sendArgs .. a .. " " elseif "-q" == a then - verbosity = -1 + APT.verbosity = -1 sendArgs = sendArgs .. a .. " " elseif "-k" == a then APT.keep = true @@ -315,8 +315,8 @@ local log = function(v, t, s, prot, test, host) end end end - if v <= verbosity then - if 3 <= verbosity then t = os.date() .. " " .. t end + if v <= APT.verbosity then + if 3 <= APT.verbosity then t = os.date() .. " " .. t end print(t .. ": " .. s) end if nil ~= APT.logFile then -- cgit v1.1