diff options
Diffstat (limited to 'tex/context/base/mkiv/trac-log.lua')
-rw-r--r-- | tex/context/base/mkiv/trac-log.lua | 10 |
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) |