summaryrefslogtreecommitdiff
path: root/tex/context/base/lpdf-xmp.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-08-18 17:40:23 +0300
committerMarius <mariausol@gmail.com>2011-08-18 17:40:23 +0300
commit5463542d926a6ca73d86251154cabc00a9333fa5 (patch)
tree33c0104835277e96d6b0474466e75963fef16de4 /tex/context/base/lpdf-xmp.lua
parentee4f24d635e0db2029f026a1c098ae76d1e537d3 (diff)
downloadcontext-5463542d926a6ca73d86251154cabc00a9333fa5.tar.gz
beta 2011.08.18 16:00
Diffstat (limited to 'tex/context/base/lpdf-xmp.lua')
-rw-r--r--tex/context/base/lpdf-xmp.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/tex/context/base/lpdf-xmp.lua b/tex/context/base/lpdf-xmp.lua
index 557141449..02d37342b 100644
--- a/tex/context/base/lpdf-xmp.lua
+++ b/tex/context/base/lpdf-xmp.lua
@@ -10,9 +10,11 @@ if not modules then modules = { } end modules ['lpdf-xmp'] = {
local format, random, char, gsub, concat = string.format, math.random, string.char, string.gsub, table.concat
local xmlfillin = xml.fillin
-local trace_xmp = false trackers.register("backend.xmp", function(v) trace_xmp = v end)
+local trace_xmp = false trackers.register("backend.xmp", function(v) trace_xmp = v end)
+local trace_info = false trackers.register("backend.info", function(v) trace_info = v end)
-local report_xmp = logs.reporter("backend","xmp")
+local report_xmp = logs.reporter("backend","xmp")
+local report_info = logs.reporter("backend","info")
local backends, lpdf = backends, lpdf
@@ -122,7 +124,11 @@ local addxmpinfo = lpdf.addxmpinfo
function lpdf.addtoinfo(tag,pdfvalue,strvalue)
addtoinfo(tag,pdfvalue)
- addxmpinfo(tag,strvalue or gsub(tostring(pdfvalue),"^%((.*)%)$","%1")) -- hack
+ local value = strvalue or gsub(tostring(pdfvalue),"^%((.*)%)$","%1") -- hack
+ if trace_info then
+ report_info("set '%s' to '%s'",tag,value)
+ end
+ addxmpinfo(tag,value)
end
-- for the do-it-yourselvers