webmcp

annotate framework/env/trace/debug.lua @ 562:328f120924a2

Removed if-clause when initializing file descriptor set to avoid compiler warning for mondelefant_conn_try_wait
author jbe
date Fri Feb 05 15:51:39 2021 +0100 (2021-02-05)
parents e00d11c12b68
children
rev   line source
jbe/bsw@0 1 --[[--
jbe@350 2 trace.debug(
jbe@350 3 value1, -- value to be converted to a string and included in the debug output
jbe@350 4 value2, -- another value to be converted to a string and included in the debug output
jbe@350 5 ...
jbe@350 6 )
poelzi@36 7
jbe/bsw@0 8
jbe@350 9 This function can be used to include debug output in the trace log. Each argument is converted to a string (using tostring(...)) and all results are concatenated with a single space character between them.
jbe/bsw@0 10
jbe/bsw@0 11 --]]--
jbe/bsw@0 12
poelzi@36 13 function trace.debug(...)
jbe@41 14 if not trace._disabled then
jbe@350 15 local values = {}
jbe@350 16 for i = 1, select("#", ...) do
jbe@350 17 values[i] = tostring((select(i, ...)))
jbe@41 18 end
jbe@350 19 trace._new_entry{ type = "debug", message = table.concat(values, " ") }
poelzi@36 20 end
jbe/bsw@0 21 end

Impressum / About Us