summaryrefslogtreecommitdiff
path: root/tex/context/base/trac-inf.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-10-29 11:35:00 +0200
committerHans Hagen <pragma@wxs.nl>2010-10-29 11:35:00 +0200
commit2e3932acbaa9da37885abbbd1f449a110c06f9a1 (patch)
tree3a4b1c5a08129cd5881cd8f8758b0ebd2fb4f80d /tex/context/base/trac-inf.lua
parenta1bbb1605334a1209f43625c174ba50ad698235e (diff)
downloadcontext-2e3932acbaa9da37885abbbd1f449a110c06f9a1.tar.gz
beta 2010.10.29 11:35
Diffstat (limited to 'tex/context/base/trac-inf.lua')
-rw-r--r--tex/context/base/trac-inf.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/tex/context/base/trac-inf.lua b/tex/context/base/trac-inf.lua
index 7bd7a7ca4..aa224cf38 100644
--- a/tex/context/base/trac-inf.lua
+++ b/tex/context/base/trac-inf.lua
@@ -13,6 +13,7 @@ if not modules then modules = { } end modules ['trac-inf'] = {
local format = string.format
local clock = os.gettimeofday or os.clock -- should go in environment
+local write_nl = texio.write_nl
statistics = statistics or { }
local statistics = statistics
@@ -108,7 +109,7 @@ end
function statistics.show(reporter)
if statistics.enable then
- if not reporter then reporter = function(tag,data,n) texio.write_nl(tag .. " " .. data) end end
+ if not reporter then reporter = function(tag,data,n) write_nl(tag .. " " .. data) end end
-- this code will move
local register = statistics.register
register("luatex banner", function()
@@ -131,18 +132,24 @@ function statistics.show(reporter)
reporter(s[1],r,n)
end
end
- texio.write_nl("") -- final newline
+ write_nl("") -- final newline
statistics.enable = false
end
end
+
+local template, nn = nil, 0 -- we only calcute it once
+
function statistics.showjobstat(tag,data,n)
if type(data) == "table" then
for i=1,#data do
statistics.showjobstat(tag,data[i],n)
end
else
- texio.write_nl(format("%-15s: %s - %s","mkiv lua stats",tag:rpadd(n," "),data))
+ if not template or n > nn then
+ template, n = format("%%-%ss: %%-%ss - %%s",15,n), nn
+ end
+ write_nl(format(template,"mkiv lua stats",tag,data))
end
end