Namespace l2dbus.Trace

L2DBUS Trace

This section describes a L2DBUS Trace capabilities.

The L2DBUS module can (optionally) be compiled with internal diagnostic tracing support. The build flag TRACE enables or disables the trace output by being defined or undefined (#define/#undef) when the module is compiled. If the module has been built with trace support then the functions in this module will control the types of trace messages that are emitted to stderr.

The trace flags associated with this module are not strictly levels of trace but rather discrete channels. This means that ERROR traces can be turned on while INFO, WARN or DEBUG might be suppressed if not explicitly enabled (or turned on}. Treat these levels as individual flags that can be selectively enabled or disabled.

Functions

setFlags (args)
getFlags ()

Constants

OFF
FATAL
ERROR
WARN
INFO
DEBUG
TRACE
ALL


Functions

setFlags (args)

Sets the trace flags for the module.

Multiple trace flags can be turned on at once, e.g.

 l2dbus.Trace.setFlags(l2dbus.Trace.WARN, l2dbus.Trace.ERROR)

Parameters:

  • args ... A list of parameters to turn on.
getFlags ()

Retrieves the trace flags that are currently enabled (on).

A Lua table is returned with the following format:

 {
     mask = 6,      -- A bitmask of all the enabled flags OR'ed together
     flags = {2, 4} -- An array of l2dbus.Trace.XXXX trace/flag constants
 }

If there are no flags set then the flags field references an empty Lua table/array.

Returns:

    table flags A table contains information of what flags are enabled.

Constants

OFF
This flag disables all tracing.
FATAL
This flag controls the output of FATAL category trace messages.
ERROR
This flag controls the output of ERROR category trace messages.
WARN
This flag controls the output of WARN category trace messages.
INFO
This flag controls the output of INFO category trace messages.
DEBUG
This flag controls the output of DEBUG category trace messages.
TRACE
This flag controls the output of TRACE category trace messages.
ALL
This flag turns on (enables) all the trace flags.
generated by LDoc 1.3