diff options
author | Marius <mariausol@gmail.com> | 2010-07-15 23:20:05 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2010-07-15 23:20:05 +0300 |
commit | 83a331fff83ac18314885a39e959ca0c10f316f7 (patch) | |
tree | 12e28253c45a07c819f98513827b0b3383dd5b0a /tex/context/base/mlib-run.lua | |
parent | b0f61c557fa27bddb54ad085c9dc9beefc851a30 (diff) | |
download | context-83a331fff83ac18314885a39e959ca0c10f316f7.tar.gz |
beta 2010-07-15 15:05
Diffstat (limited to 'tex/context/base/mlib-run.lua')
-rw-r--r-- | tex/context/base/mlib-run.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tex/context/base/mlib-run.lua b/tex/context/base/mlib-run.lua index b961fa02c..0467498d0 100644 --- a/tex/context/base/mlib-run.lua +++ b/tex/context/base/mlib-run.lua @@ -33,14 +33,19 @@ local trace_graphics = false trackers.register("metapost.graphics", function(v) local report_mplib = logs.new("mplib") +local texerrormessage = tracers.texerrormessage + local format, gsub, match = string.format, string.gsub, string.match local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming metapost = metapost or { } -metapost.showlog = false -metapost.lastlog = "" +metapost.showlog = false +metapost.lastlog = "" +metapost.texerrors = false + +directives.register("mplib.texerrors", function(v) metapost.texerrors = v end) function metapost.resetlastlog() metapost.lastlog = "" @@ -127,10 +132,10 @@ function metapost.reporterror(result) elseif result.status > 0 then local t, e, l = result.term, result.error, result.log if t and t ~= "" then - report_mplib("mp terminal: %s",t) + (metapost.texerrors and texerrormessage or report_mplib)("mp terminal: %s",t) end if e then - report_mplib("mp error: %s",(e=="" and "?") or e) + (metapost.texerrors and texerrormessage or report_mplib)("mp error: %s",(e=="" and "?") or e) end if not t and not e and l then metapost.lastlog = metapost.lastlog .. "\n" .. l |