summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-04-03 21:38:18 +0000
committerKarl Berry <karl@freefriends.org>2018-04-03 21:38:18 +0000
commit3fb0ad9f253c3ebf81ce763d3f6ddb3f9d9f4191 (patch)
tree41cb948bdec6398d9a899bde276f561b42364f25 /Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
parent10bc59082551160a5434cb4c7fcfdc7816bb647d (diff)
context (3apr18)
git-svn-id: svn://tug.org/texlive/trunk@47272 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/trac-log.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-log.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
index c7b6f6d2df2..1471bd4c7f2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-log.lua
+++ b/Master/texmf-dist/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)