diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-07-02 16:09:16 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-07-02 16:09:16 +0200 |
commit | 847821faaecf92833f1e1564e1ef9377758d4d45 (patch) | |
tree | 7a033668d823e231478c055daeb47c4582883059 /tex/generic/context/luatex/luatex-fonts.lua | |
parent | 052a096e160508ddbbbfcbf1522eb8ddbfc3b1cd (diff) | |
download | context-847821faaecf92833f1e1564e1ef9377758d4d45.tar.gz |
2018-07-02 14:46:00
Diffstat (limited to 'tex/generic/context/luatex/luatex-fonts.lua')
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts.lua | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/tex/generic/context/luatex/luatex-fonts.lua b/tex/generic/context/luatex/luatex-fonts.lua index 058c3b5a5..16c85ddc2 100644 --- a/tex/generic/context/luatex/luatex-fonts.lua +++ b/tex/generic/context/luatex/luatex-fonts.lua @@ -67,7 +67,7 @@ end if not generic_context.push_namespaces then function generic_context.push_namespaces() - texio.write(" <push namespace>") + -- logs.report("system","push namespace") local normalglobal = { } for k, v in next, _G do normalglobal[k] = v @@ -77,7 +77,7 @@ if not generic_context.push_namespaces then function generic_context.pop_namespaces(normalglobal,isolate) if normalglobal then - texio.write(" <pop namespace>") + -- logs.report("system","pop namespace") for k, v in next, _G do if not normalglobal[k] then generic_context[k] = v @@ -92,7 +92,7 @@ if not generic_context.push_namespaces then -- just to be sure: setmetatable(generic_context,_G) else - texio.write(" <fatal error: invalid pop of generic_context>") + logs.report("system","fatal error: invalid pop of generic_context") os.exit() end end @@ -119,9 +119,26 @@ local starttime = os.gettimeofday() -- kpse.set_program_name("luatex") +-- One can define texio.reporter as alternative terminal/log writer. That's as far +-- as I want to go with this. + local ctxkpse = nil local verbose = true +if not logs or not logs.report then + if not logs then + logs = { } + end + function logs.report(c,f,...) + local r = texio.reporter or texio.write_nl + if f then + r(c .. " : " .. string.format(f,...)) + else + r("") + end + end +end + local function loadmodule(name,continue) local foundname = kpse.find_file(name,"tex") or "" if not foundname then @@ -132,12 +149,12 @@ local function loadmodule(name,continue) end if foundname == "" then if not continue then - texio.write_nl(string.format(" <luatex-fonts: unable to locate %s>",name)) + logs.report("system","unable to locate file '%s'",name) os.exit() end else if verbose then - texio.write(string.format(" <%s>",foundname)) -- no file.basename yet + logs.report("system","loading '%s'",foundname) -- no file.basename yet end dofile(foundname) end @@ -328,6 +345,6 @@ end -- We're done. -texio.write(string.format(" <luatex-fonts.lua loaded in %0.3f seconds>", os.gettimeofday()-starttime)) +logs.report("system","luatex-fonts.lua loaded in %0.3f seconds", os.gettimeofday()-starttime) generic_context.pop_namespaces(whatever) |