diff options
author | onefang | 2019-12-23 13:06:44 +1000 |
---|---|---|
committer | onefang | 2019-12-23 13:06:44 +1000 |
commit | 7dccd1610618ccea2567afa38fa91eec11cbf432 (patch) | |
tree | af9592b92cfc43568b9bcd0e84bc6a4dab39a5e5 | |
parent | A little OCD, didn't matter much. (diff) | |
download | apt-panopticon-7dccd1610618ccea2567afa38fa91eec11cbf432.zip apt-panopticon-7dccd1610618ccea2567afa38fa91eec11cbf432.tar.gz apt-panopticon-7dccd1610618ccea2567afa38fa91eec11cbf432.tar.bz2 apt-panopticon-7dccd1610618ccea2567afa38fa91eec11cbf432.tar.xz |
Promote verbosity to become an externally visible entity.
Diffstat (limited to '')
-rw-r--r-- | apt-panopticommon.lua | 10 |
1 files 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' | |||
6 | APT.protocols = {"ftp", "http", "https", "rsync"} | 6 | APT.protocols = {"ftp", "http", "https", "rsync"} |
7 | APT.tests = {'raw', 'Integrity', 'Protocol', 'Updated', 'URLSanity', 'Speed'} | 7 | APT.tests = {'raw', 'Integrity', 'Protocol', 'Updated', 'URLSanity', 'Speed'} |
8 | 8 | ||
9 | verbosity = -1 | 9 | APT.verbosity = -1 |
10 | APT.origin = false | 10 | APT.origin = false |
11 | APT.keep = false | 11 | APT.keep = false |
12 | 12 | ||
@@ -92,10 +92,10 @@ APT.parseArgs = function(args) | |||
92 | elseif "--version" == a then | 92 | elseif "--version" == a then |
93 | print("apt-panopticon version 0.1 WIP development version") | 93 | print("apt-panopticon version 0.1 WIP development version") |
94 | elseif "-v" == a then | 94 | elseif "-v" == a then |
95 | verbosity = verbosity + 1 | 95 | APT.verbosity = APT.verbosity + 1 |
96 | sendArgs = sendArgs .. a .. " " | 96 | sendArgs = sendArgs .. a .. " " |
97 | elseif "-q" == a then | 97 | elseif "-q" == a then |
98 | verbosity = -1 | 98 | APT.verbosity = -1 |
99 | sendArgs = sendArgs .. a .. " " | 99 | sendArgs = sendArgs .. a .. " " |
100 | elseif "-k" == a then | 100 | elseif "-k" == a then |
101 | APT.keep = true | 101 | APT.keep = true |
@@ -315,8 +315,8 @@ local log = function(v, t, s, prot, test, host) | |||
315 | end | 315 | end |
316 | end | 316 | end |
317 | end | 317 | end |
318 | if v <= verbosity then | 318 | if v <= APT.verbosity then |
319 | if 3 <= verbosity then t = os.date() .. " " .. t end | 319 | if 3 <= APT.verbosity then t = os.date() .. " " .. t end |
320 | print(t .. ": " .. s) | 320 | print(t .. ": " .. s) |
321 | end | 321 | end |
322 | if nil ~= APT.logFile then | 322 | if nil ~= APT.logFile then |