summaryrefslogtreecommitdiff
path: root/tex/context/base/trac-log.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-03-13 20:40:18 +0200
committerMarius <mariausol@gmail.com>2013-03-13 20:40:18 +0200
commit81cdb024df2aaf01f5f9d76d956b4c1b80c2ae51 (patch)
treeffa5e7f78a20b108ebc95017de09162024a52e27 /tex/context/base/trac-log.lua
parent793a738b467b82ff9a5c8d2c7bd3b473ada7feba (diff)
downloadcontext-81cdb024df2aaf01f5f9d76d956b4c1b80c2ae51.tar.gz
beta 2013.03.13 19:31
Diffstat (limited to 'tex/context/base/trac-log.lua')
-rw-r--r--tex/context/base/trac-log.lua80
1 files changed, 71 insertions, 9 deletions
diff --git a/tex/context/base/trac-log.lua b/tex/context/base/trac-log.lua
index 2b84ba487..6a6bd39cb 100644
--- a/tex/context/base/trac-log.lua
+++ b/tex/context/base/trac-log.lua
@@ -6,6 +6,60 @@ if not modules then modules = { } end modules ['trac-log'] = {
license = "see context related readme files"
}
+if tex and (tex.jobname or tex.formatname) then
+
+ -- quick hack, awaiting speedup in engine (8 -> 6.4 sec for --make with console2)
+
+ local texio_write_nl = texio.write_nl
+ local texio_write = texio.write
+ local io_write = io.write
+
+ local write_nl = function(target,...)
+ if not io_write then
+ io_write = io.write
+ end
+ if target == "term and log" then
+ texio_write_nl("log",...)
+ texio_write_nl("term","")
+ io_write(...)
+ elseif target == "log" then
+ texio_write_nl("log",...)
+ elseif target == "term" then
+ texio_write_nl("term","")
+ io_write(...)
+ else
+ texio_write_nl("log",...)
+ texio_write_nl("term","")
+ io_write(target,...)
+ end
+ end
+
+ local write = function(target,...)
+ if not io_write then
+ io_write = io.write
+ end
+ if target == "term and log" then
+ texio_write("log",...)
+ io_write(...)
+ elseif target == "log" then
+ texio_write("log",...)
+ elseif target == "term" then
+ io_write(...)
+ else
+ texio_write("log",...)
+ io_write(target,...)
+ end
+ end
+
+ texio.write = write
+ texio.write_nl = write_nl
+
+else
+
+ -- texlua
+
+end
+
-- todo: less categories, more subcategories (e.g. nodes)
-- todo: split into basics and ctx specific
@@ -217,8 +271,6 @@ if tex and (tex.jobname or tex.formatname) then
else
--- local format = string.formatter
-
logs.flush = ignore
writer = write_nl
@@ -449,6 +501,16 @@ function logs.show()
report("logging","categories: %s, max category: %s, max subcategory: %s, max combined: %s",n,c,s,max)
end
+local delayed_reporters = { } setmetatableindex(delayed_reporters,function(t,k)
+ local v = logs.reporter(k)
+ t[k] = v
+ return v
+end)
+
+function utilities.setters.report(setter,...)
+ delayed_reporters[setter](...)
+end
+
directives.register("logs.blocked", function(v)
setblocked(v,true)
end)
@@ -513,15 +575,12 @@ function logs.stop_page_number() -- the first page can includes the initializati
logs.flush()
end
-logs.report_job_stat = statistics and statistics.showjobstat
+-- we don't have show_open and show_close callbacks yet
local report_files = logs.reporter("files")
-
-local nesting = 0
-local verbose = false
-local hasscheme = url.hasscheme
-
--- we don't have show_open and show_close callbacks yet
+local nesting = 0
+local verbose = false
+local hasscheme = url.hasscheme
function logs.show_open(name)
-- if hasscheme(name) ~= "virtual" then
@@ -699,3 +758,6 @@ end
io.stdout:setvbuf('no')
io.stderr:setvbuf('no')
+
+-- windows: > nul 2>&1
+-- unix : > null 2>&1