summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/make4ht/make4ht-logging.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-20 22:20:13 +0000
committerKarl Berry <karl@freefriends.org>2021-03-20 22:20:13 +0000
commitc401f68497eea2603e3c5a8742b032335fc6dfce (patch)
tree4a20a407fd27e90ebb9ea2493a89539344d2910a /Master/texmf-dist/scripts/make4ht/make4ht-logging.lua
parent18d932604c99399d6fd9d26967b6e9bd2553898b (diff)
make4ht (20mar21)
git-svn-id: svn://tug.org/texlive/trunk@58563 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/make4ht/make4ht-logging.lua')
-rwxr-xr-xMaster/texmf-dist/scripts/make4ht/make4ht-logging.lua13
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()