PDA

View Full Version : read girder's logs with LUA



brik
January 2nd, 2010, 06:54 AM
Hello,
I am trying to read girder's log and send the content to an LCD.
Is it possible to do a such thing with LUA ? (second part shouldn't be a problem)

but how can I send girder's log content to a variable ?

Any idea ?

Thanks in advance.
brik

brik
January 2nd, 2010, 11:49 AM
OK...I found the payloads argument for event.exe

then get data back with this script :

function MyCallback(event, device, mod, payloads, id)
print(event); print(device); print(mod)
for i=1, 4 do print(payloads[i]) end
end
MyCallbackID = gir.AddEventHandler(".*", 18, 18, MyCallback)
-- And later in cleanup code:
gir.RemoveEventHandler(MyCallbackID); MyCallback = nil; MyCallbackID = nil

That's all I needed.