Log question.

Hi guys. Just getting going on development. Quick question on the log ( /var/log/cmh/LuaUPnP.log). If I execute the following code (via my Web portal on my Vera Lite under Develop Apps), the log output is very much delayed. Sometimes by 10 seconds or more. Is this just a delay waiting for the device to respond? The device is a Mimolite. I’m using PuTTy to ssh into my vera lite to view the log (tail -f).

local value = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Tripped”, 4)
luup.log("The variable Tripped for device 4 is: " … value)

Thanks.

The delay you see is due to the write delay to flash memory. If will buffer the data into memory and than flush it out to the flash memory every so often to preserve the life of the memory.

  • Garrett

Oh I see (thanks for the quick reply). So it holds onto some and flushes it later…makes sense…Is there a way to see more real time logging…I mean as a debugging tool? So if I have some luup code that I’m testing, can I use some other “write to somewhere” method to instantly see the result? Or can I just “echo” the result to that “Test Luup Code” window?

Any developer hints would be great!!! How about a “hello world app”?

Thanks.

If you run your code using LuaTest you can use Lua print statements to see what’s happening.

You could also use kwikLog to write messages to a file that can be viewed with a browser.

Switch your logs to Verbose mode (via UI) and they’ll flush faster…

thanks guys…