From b85a3646ea13a26b2d8506531d2bdf072db81837 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 11 Apr 2013 00:18:13 +0200 Subject: enable overrides for Context loggers --- otfl-luat-ovr.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'otfl-luat-ovr.lua') diff --git a/otfl-luat-ovr.lua b/otfl-luat-ovr.lua index 63a9e19..984dbf5 100644 --- a/otfl-luat-ovr.lua +++ b/otfl-luat-ovr.lua @@ -7,30 +7,31 @@ if not modules then modules = { } end modules ['luat-ovr'] = { } -local write_nl, format, name = texio.write_nl, string.format, "luaotfload" -local dummyfunction = function() end +local module_name = "luaotfload" -callbacks = { - register = dummyfunction, -} +local texiowrite_nl = texio.write_nl +local stringformat = string.format +local ioflush = io.flush +local dummyfunction = function() end function logs.report(category,fmt,...) if fmt then - write_nl('log', format("%s | %s: %s",name,category,format(fmt,...))) + texiowrite_nl('log', stringformat("%s | %s: %s",module_name,category,stringformat(fmt,...))) elseif category then - write_nl('log', format("%s | %s",name,category)) + texiowrite_nl('log', stringformat("%s | %s",module_name,category)) else - write_nl('log', format("%s |",name)) + texiowrite_nl('log', stringformat("%s |",module_name)) end end function logs.info(category,fmt,...) if fmt then - write_nl(format("%s | %s: %s",name,category,format(fmt,...))) + texiowrite_nl(stringformat("%s | %s: %s",module_name,category,stringformat(fmt,...))) elseif category then - write_nl(format("%s | %s",name,category)) + texiowrite_nl(stringformat("%s | %s",module_name,category)) else - write_nl(format("%s |",name)) + texiowrite_nl(stringformat("%s |",module_name)) end - io.flush() + ioflush() end + -- cgit v1.2.3