File: lua_log_api.rst

package info (click to toggle)
wireplumber 0.5.12-3
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,244 kB
  • sloc: ansic: 41,043; python: 391; sh: 62; makefile: 57; xml: 23
file content (83 lines) | stat: -rw-r--r-- 2,465 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.. _lua_log_api:

Debug Logging
=============

Constructors
~~~~~~~~~~~~

.. function:: Log.open_topic(topic)

   Opens a LogTopic with the given topic name. Well known script topics are
   described in :ref:`daemon_logging`, and messages from scripts shall use
   **s-***.

   Example:

   .. code-block:: lua

     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.

   :param string topic: The log topic to open
   :returns: the log topic object
   :rtype: Log (:c:struct:`WpLogTopic`)

Methods
~~~~~~~

.. function:: Log.warning(object, message)

   Logs a warning message, like :c:macro:`wp_warning_object`

   :param object: optional object to associate the message with; you
      may skip this and just start with the *message* as the first parameter
   :type object: GObject or GBoxed
   :param string message: the warning message to log

.. function:: Log.notice(object, message)

   Logs a notice message, like :c:macro:`wp_notice_object`

   :param object: optional object to associate the message with; you
      may skip this and just start with the *message* as the first parameter
   :type object: GObject or GBoxed
   :param string message: the normal message to log

.. function:: Log.info(object, message)

   Logs a info message, like :c:macro:`wp_info_object`

   :param object: optional object to associate the message with; you
      may skip this and just start with the *message* as the first parameter
   :type object: GObject or GBoxed
   :param string message: the info message to log

.. function:: Log.debug(object, message)

   Logs a debug message, like :c:macro:`wp_debug_object`

   :param object: optional object to associate the message with; you
      may skip this and just start with the *message* as the first parameter
   :type object: GObject or GBoxed
   :param string message: the debug message to log

.. function:: Log.trace(object, message)

   Logs a trace message, like :c:macro:`wp_trace_object`

   :param object: optional object to associate the message with; you
      may skip this and just start with the *message* as the first parameter
   :type object: GObject or GBoxed
   :param string message: the trace message to log

.. function:: Debug.dump_table(t)

   Prints a table with all its contents, recursively, to stdout
   for debugging purposes

   :param table t: any table