summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/trac-log.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-04-02 16:25:10 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-04-02 16:25:10 +0200
commit15ab7c153a96a9befc4e2c1774e701f3c941cc2d (patch)
tree4262a9085036949283dd3e56d992111a9745c680 /tex/context/base/mkiv/trac-log.lua
parent37c561c2f98d84fc02011b7b819ae8cf9bb4b10d (diff)
downloadcontext-15ab7c153a96a9befc4e2c1774e701f3c941cc2d.tar.gz
2018-04-02 15:51:00
Diffstat (limited to 'tex/context/base/mkiv/trac-log.lua')
-rw-r--r--tex/context/base/mkiv/trac-log.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/trac-log.lua b/tex/context/base/mkiv/trac-log.lua
index c7b6f6d2d..1471bd4c7 100644
--- a/tex/context/base/mkiv/trac-log.lua
+++ b/tex/context/base/mkiv/trac-log.lua
@@ -10,7 +10,6 @@ if not modules then modules = { } end modules ['trac-log'] = {
-- terminal handler in lua then. Ok, maybe it's slower then, so a no-go.
local next, type, select, print = next, type, select, print
-local write_nl, write = texio and texio.write_nl or print, texio and texio.write or io.write
local format, gmatch, find = string.format, string.gmatch, string.find
local concat, insert, remove = table.concat, table.insert, table.remove
local topattern = string.topattern
@@ -18,6 +17,13 @@ local utfchar = utf.char
local datetime = os.date
local openfile = io.open
+local runningtex = tex and (tex.jobname or tex.formatname)
+-- local write_nl = texio and texio.write_nl or print
+-- local write = texio and texio.write or io.write
+
+local write_nl = runningtex and texio and texio.write_nl or print
+local write = runningtex and texio and texio.write or io.write
+
local setmetatableindex = table.setmetatableindex
local formatters = string.formatters
local settings_to_hash = utilities.parsers.settings_to_hash
@@ -108,7 +114,7 @@ local direct, subdirect, writer, pushtarget, poptarget, setlogfile, settimedlog,
-- we don't want this overhead for single messages (not that there are that
-- many; we could have a special weak table)
-if tex and (tex.jobname or tex.formatname) then
+if runningtex then
if texio.setescape then
texio.setescape(0) -- or (false)