Debug Logging¶
Constructors¶
-
Log.open_topic(topic)¶ Opens a LogTopic with the given topic name. Well known script topics are described in Debug Logging, and messages from scripts shall use s-*.
Example:
local obj log = Log.open_topic ("s-linking") log:info (obj, "an info message on obj") log:debug ("a debug message")
Above example shows how to output debug logs.
Parameters: topic (string) – The log topic to open Returns: the log topic object Return type: Log (:c:struct:`WpLogTopic`)
Methods¶
-
Log.warning(object, message)¶ Logs a warning message, like
wp_warning_objectParameters: - object (GObject or GBoxed) – optional object to associate the message with; you may skip this and just start with the message as the first parameter
- message (string) – the warning message to log
-
Log.notice(object, message)¶ Logs a notice message, like
wp_notice_objectParameters: - object (GObject or GBoxed) – optional object to associate the message with; you may skip this and just start with the message as the first parameter
- message (string) – the normal message to log
-
Log.info(object, message)¶ Logs a info message, like
wp_info_objectParameters: - object (GObject or GBoxed) – optional object to associate the message with; you may skip this and just start with the message as the first parameter
- message (string) – the info message to log
-
Log.debug(object, message)¶ Logs a debug message, like
wp_debug_objectParameters: - object (GObject or GBoxed) – optional object to associate the message with; you may skip this and just start with the message as the first parameter
- message (string) – the debug message to log
-
Log.trace(object, message)¶ Logs a trace message, like
wp_trace_objectParameters: - object (GObject or GBoxed) – optional object to associate the message with; you may skip this and just start with the message as the first parameter
- message (string) – the trace message to log
-
Debug.dump_table(t)¶ Prints a table with all its contents, recursively, to stdout for debugging purposes
Parameters: t (table) – any table