Lua Logging functions
dw.log.debug
dw.log.debug(level, message)
Description
Logs a message to the internal debug log file.
Inputs
- level: Common values are "INFO" and "WARN". Available values are "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "DEBUG1", "DEBUG2", "DEBUG3", and "DEBUG4".
- message: The log message.
Outputs
- None
dw.log.debug("INFO","Log Message")
dw.log.debug("ERROR","Device not available.")
Example
dw.log.debug("INFO","Power level is high.")
This will log a debug log entry with the level as "INFO"
and the message as "Power level is high."
dw.log.exception
dw.log.exception(level, message, component)
Description
Logs a message to the Exceptions Log file of the system. The component parameter is optional, so this can be used as 2 parameters (level,message), or 3 parameters (level,message,component).
Inputs
- level: Common values are "INFO" and "ERROR". Available values are "FATAL", "ERROR", "WARN", and "INFO". Default value is "INFO".
- message: The log message.
- component: Optional. The component to log under. Common values are "System" and "DeviceManager". Default value is "Lua Action".
Outputs
- None
dw.log.exception("INFO","Message from Lua.")
dw.log.exception("ERROR","Error Message","System")
Examples
dw.log.exception("WARN","Power level is low.")
This will log an Exceptions Log entry with Type as
"WARN", the default Component as "Lua Action" and the
message as "Power level is low."
dw.log.exception("INFO","Signal strength is low.","Modem Manager")
This will log an Exceptions Log entry with Type as
"INFO", the Component as "Modem Manager" and the message as
"Signal strength is low."
Related topics
For information on the generating a diagnostics file,
which will include the internal debug log files, see
Diagnostics.
For information on the Exceptions log feature, see Exceptions Log.