diff options
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/make4ht-logging.lua')
-rwxr-xr-x | Master/texmf-dist/scripts/make4ht/make4ht-logging.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Master/texmf-dist/scripts/make4ht/make4ht-logging.lua b/Master/texmf-dist/scripts/make4ht/make4ht-logging.lua index c1d2b24a577..63b11433ea4 100755 --- a/Master/texmf-dist/scripts/make4ht/make4ht-logging.lua +++ b/Master/texmf-dist/scripts/make4ht/make4ht-logging.lua @@ -6,6 +6,7 @@ local levels = {} -- level of bugs that should be shown local show_level = 1 local max_width = 0 +local max_status = 0 logging.use_colors = true @@ -14,8 +15,8 @@ logging.modes = { {name = "info", color = 32}, {name = "status", color = 37}, {name = "warning", color = 33}, - {name = "error", color = 31}, - {name = "fatal", color = 35} + {name = "error", color = 31, status = 1}, + {name = "fatal", color = 35, status = 2} } -- prepare table with mapping between mode names and corresponding levels @@ -62,7 +63,10 @@ function logging.new(module) for _, mode in ipairs(logging.modes) do local name = mode.name local color = mode.color + local status = mode.status or 0 obj[name] = function(self, ...) + -- set make4ht exit status + max_status = math.max(status, max_status) -- max width is saved in logging.prepare_levels if mode.level >= show_level then -- support variable number of parameters @@ -82,6 +86,11 @@ function logging.new(module) end +-- exit make4ht with maximal error status +function logging.exit_status() + os.exit(max_status) +end + -- prepare default levels logging.prepare_levels() |