summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua54
1 files changed, 50 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua
index 99a6611e256..5e642e4f802 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-override.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['luat-ovr'] = {
license = "GNU GPL v2"
}
-local module_name = "luaotfload"
+local module_name = "luaotfload"
local texiowrite_nl = texio.write_nl
local stringformat = string.format
@@ -72,7 +72,34 @@ local stdout = function (category, fmt, ...)
texiowrite_nl(tableconcat(res))
end
-local level_ids = { common = 0, loading = 1, search = 2 }
+--- at default (zero), we aim to be quiet
+local level_ids = { common = 1, loading = 2, search = 3 }
+
+--[[doc--
+
+ The names_report logger is used more or less all over luaotfload.
+ Its requirements are twofold:
+
+ 1) Provide two logging channels, the terminal and the log file;
+ 2) Allow for control over verbosity levels.
+
+ The first part is addressed by specifying the log *mode* as the
+ first argument that can be either “log”, meaning the log file, or
+ “both”: log file and stdout. Anything else is taken as referring to
+ stdout only.
+
+ Verbosity levels, though not as fine-grained as e.g. Context’s
+ system of tracers, allow keeping the logging spam caused by
+ different subsystems manageable. By default, luaotfload will not
+ emit anything if things are running smoothly on level zero. Only
+ warning messages are relayed, while the other messages are skipped
+ over. (This is a little sub-optimal performance-wise since the
+ function calls to the logger are executed regardless.) The log
+ level during a Luatex run can be adjusted by setting the “loglevel”
+ field in config.luaotfload, or by calling logs.set_loglevel() as
+ defined above.
+
+--doc]]--
local names_report = function (mode, lvl, ...)
if type(lvl) == "string" then
@@ -96,6 +123,24 @@ logs.names_report = names_report
--[[doc--
+ The fontloader comes with the Context logging mechanisms
+ inaccessible. Instead, it provides dumb fallbacks based
+ on the functions in texio.write*() that can be overridden
+ by providing a function texio.reporter().
+
+ The fontloader output can be quite verbose, so we disable
+ it entirely by default.
+
+--doc]]--
+
+local texioreporter = function (message)
+ names_report("log", 2, message)
+end
+
+texio.reporter = texioreporter
+
+--[[doc--
+
Adobe Glyph List.
-------------------------------------------------------------------
@@ -128,10 +173,11 @@ if fonts then --- need to be running TeX
if k == "unicodes" then
local glyphlist = resolvers.findfile"luaotfload-glyphlist.lua"
if glyphlist then
- names_report("both", 0, "load", "loading the Adobe glyph list")
+ names_report("log", 1, "load", "loading the Adobe glyph list")
else
glyphlist = resolvers.findfile"font-age.lua"
- names_report("both", 0, "load", "loading the extended glyph list from ConTeXt")
+ names_report("both", 0, "load",
+ "loading the extended glyph list from ConTeXt")
end
local unicodes = dofile(glyphlist)
fonts.encodings.agl = { unicodes = unicodes }