diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2018-09-08 18:38:09 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2018-09-08 18:38:15 +0200 |
commit | 318e8a990ebe94c48f69d3bb1d342a31cf55f1db (patch) | |
tree | bd0796fc12ebe6dcc7d6c1a3a5df5eaedb8fdb27 /cal.lua | |
parent | 35aaedc729970ae2c5aa26738babd6c9939e338c (diff) | |
download | caldr-318e8a990ebe94c48f69d3bb1d342a31cf55f1db.tar.gz |
common, cal: rework debug printers
* prefix messages to indicate the debug level
* colorize when printing to terminal
This introduces a dependency on luaposix.
Diffstat (limited to 'cal.lua')
-rw-r--r-- | cal.lua | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -224,7 +224,7 @@ local parse_calendar_lines do --]]-- local add_param = function (t, k, v) - debugln ("»»»» add_param ({%s}, %s, %s)", t, tostring (k), tostring (v)) + debugln ("add_param ({%s}, %s, %s)", t, tostring (k), tostring (v)) t [#t + 1] = { name = k, value = v } @@ -279,7 +279,7 @@ local parse_calendar_lines do if ok == false then pos1 = skip_line (raw, pos0) if pos0 == pos1 then - noiseln ("»»» [%d] reached EOF, terminating after %d bytes, \z + noiseln ("[%d] reached EOF, terminating after %d bytes, \z %d calendar lines", pos0, consumed, nline) return acc @@ -287,7 +287,7 @@ local parse_calendar_lines do errorln ("[%d–%d] %d bad content line; skipping", pos0, pos1, nline) nskipped = nskipped + 1 else - noiseln ("»»» [%d–%d] “%s” [%s] “%s”", + noiseln ("[%d–%d] “%s” [%s] “%s”", pos0, pos1, name, fmt_calendar_params (params), value) acc [#acc + 1] = { pos = { pos0, pos1 } , name = name, params = params, value = value } |