aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-11-07 17:53:03 +0100
committerMatěj Cepl <mcepl@cepl.eu>2023-11-07 17:53:03 +0100
commiteb0a541d5d250d6d6559be509c71e12f39230a01 (patch)
tree33511e20bb07154c4f0efe18d8cbdcbabe3eb44e
parent89e27b5e7acfa274099feb2cd6dd6da010ade33a (diff)
downloadvis-par-eb0a541d5d250d6d6559be509c71e12f39230a01.tar.gz
Make logging configuarble.
-rw-r--r--init.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 8bcba8e..0276b4a 100644
--- a/init.lua
+++ b/init.lua
@@ -5,12 +5,15 @@ local M = {}
M.par_prg = "par"
M.par_tw = 72
M.ex_args = function () return "RET4bhgqw" .. M.par_tw end
+M.debug = false
-- ex_args = "RET4bhgqB=.,?_A_aQ=_s>|w" .. par_tw
-- export PARINIT='Tbp2hgqR B=.,?_A_a Q=_s>|'
function print(...)
- _print_ = _print_ or io.open("/tmp/visprint", "w")
- _print_:write(..., "\n")
+ if M.debug then
+ _print_ = _print_ or io.open("/tmp/visprint", "w")
+ _print_:write(..., "\n")
+ end
end
--- Dump value of a variable in a formatted string