summaryrefslogtreecommitdiff
path: root/tex/context/base/trac-log.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-08-07 12:20:30 +0300
committerMarius <mariausol@gmail.com>2013-08-07 12:20:30 +0300
commit0a1d66e9356ae4676438c7e1865d71331437e412 (patch)
treef217ccdca72b8506d847948a2fd9c9d496daef22 /tex/context/base/trac-log.lua
parentf0394aa3f47f9256e67c3535fbb9fe8cbd70d50c (diff)
downloadcontext-0a1d66e9356ae4676438c7e1865d71331437e412.tar.gz
beta 2013.08.07 10:55
Diffstat (limited to 'tex/context/base/trac-log.lua')
-rw-r--r--tex/context/base/trac-log.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/tex/context/base/trac-log.lua b/tex/context/base/trac-log.lua
index 0ae5d87e3..4ef50f5f4 100644
--- a/tex/context/base/trac-log.lua
+++ b/tex/context/base/trac-log.lua
@@ -271,7 +271,8 @@ if tex and (tex.jobname or tex.formatname) then
translations = t
end
- setlogfile = ignore
+ setlogfile = ignore
+ settimedlog = ignore
else
@@ -339,8 +340,6 @@ else
setformats = ignore
settranslations = ignore
- local f_timed = formatters["[%S] "]
-
setlogfile = function(name,keepopen)
if name and name ~= "" then
local localtime = os.localtime
@@ -349,17 +348,27 @@ else
local f = io.open(name,"ab")
write_nl = function(s)
writeline(s)
- f:write(f_timed(localtime()),s,"\n")
+ f:write(localtime()," | ",s,"\n")
end
else
write_nl = function(s)
writeline(s)
local f = io.open(name,"ab")
- f:write(f_timed(localtime()),s,"\n")
+ f:write(localtime()," | ",s,"\n")
f:close()
end
end
end
+ setlogfile = ignore
+ end
+
+ settimedlog = function()
+ local localtime = os.localtime
+ local writeline = write_nl
+ write_nl = function(s)
+ writeline(localtime() .. " | " .. s)
+ end
+ settimedlog = ignore
end
end
@@ -374,6 +383,7 @@ logs.setformats = setformats
logs.settranslations = settranslations
logs.setlogfile = setlogfile
+logs.settimedlog = settimedlog
logs.direct = direct
logs.subdirect = subdirect