Hi Hans, Lately, I am doing quite a lot of work with CLD, and sometimes I do not trust my Lua code completely. To allow some rudimentary debugging, I have patched my local cldf-ini.lua to contain this: local dumpfile = io.open('dumpfile.txt', 'w') local function flush (z,...) if type(z) == 'number' then dumpfile:write(string.format('%02d ', z)) else dumpfile:write(' ') dumpfile:write(z) end for _,v in ipairs({...}) do dumpfile:write (v) end dumpfile:write ('\n') texsprint(z,...) end instead of the normal local flush = texsprint That way, I can look in dumpfile.txt to make sure that the correct ConTeXt code is generated. Is there any chance that you could offer a tracker/messaging feature with similar functionality? Patching cldf-ini.lua is not nice ;) Best wishes, Taco
On 1/15/2015 2:54 PM, Taco Hoekwater wrote:
Hi Hans,
Lately, I am doing quite a lot of work with CLD, and sometimes I do not trust my Lua code completely. To allow some rudimentary debugging, I have patched my local cldf-ini.lua to contain this:
local dumpfile = io.open('dumpfile.txt', 'w') local function flush (z,...) if type(z) == 'number' then dumpfile:write(string.format('%02d ', z)) else dumpfile:write(' ') dumpfile:write(z) end for _,v in ipairs({...}) do dumpfile:write (v) end dumpfile:write ('\n') texsprint(z,...) end
instead of the normal
local flush = texsprint
That way, I can look in dumpfile.txt to make sure that the correct ConTeXt code is generated. Is there any chance that you could offer a tracker/messaging feature with similar functionality? Patching cldf-ini.lua is not nice ;)
\enabletrackers[context.*] ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 1/15/2015 3:37 PM, Taco Hoekwater wrote:
On 15 Jan 2015, at 15:21, Hans Hagen
wrote: \enabletrackers[context.*]
Nice, thanks. (Now I wonder how I missed that).
probably because it's an overload and not an "if tracing then else end" in the source and that's easy to overlook Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Taco Hoekwater