-
Notifications
You must be signed in to change notification settings - Fork 2
Default Subscriber
Reference page for the default subscriber provided.
This method allows you to control whether the trace level (e.g., INFO, DEBUG) is displayed in the captured trace messages.
-
displayed(bool): If set totrue, the trace level is displayed in the trace messages; if set tofalse, the trace level is omitted.
[2023-11-02T12:02:36] INFO src/test.gd::_ready: this is a log
^^^^
[2023-11-02T12:02:36] src/test.gd::_ready: this is a log
You can use this method to enable or disable colored output for trace messages.
-
displayed(bool): When set totrue, colored output is enabled; when set tofalse, colored output is disabled.
This method controls whether the module information is displayed in trace messages.
-
displayed(bool): If set totrue, the module information is displayed; if set tofalse, the module information is omitted.
[2023-11-02T12:02:36] INFO src/test.gd::_ready: this is a log
^^^^^^^^^^^
[2023-11-02T12:02:36] INFO _ready: this is a log
You can use this method to control whether the function information is displayed in the trace messages.
-
displayed(bool): If set totrue, the function information is displayed; if set tofalse, the function information is omitted.
[2023-11-02T12:02:36] INFO src/test.gd::_ready: this is a log
^^^^^^
[2023-11-02T12:02:36] INFO src/test.gd: this is a log
This method enables or disables the display of timestamps in trace messages.
-
displayed(bool): When set totrue, timestamps are displayed; when set tofalse, timestamps are omitted.
[2023-11-02T12:02:36] INFO src/test.gd::_ready: this is a log
^^^^^^^^^^^^^^^^^^^^^
INFO src/test.gd::_ready: this is a log
You can use this method to specify whether the thread ID is displayed in trace messages.
-
displayed(bool): If set totrue, the thread ID is displayed; if set tofalse, the thread ID is omitted.
[2023-11-02T12:02:36] INFO src/test.gd::_ready: this is a log
ThreadId(1) [2023-11-02T12:02:36] INFO src/test.gd::_ready: this is a log
^^^^^^^^^^^
This method controls the use of nicer colors in the output of trace messages. This will make the godot console colors look better but will disable colors for the external shell the editor might be running in.
-
displayed(bool): If set totrue, nicer colors are used; if set tofalse, standard colors are used.
The barebones method provides a shortcut to configure the TraceSubscriber with commonly used settings. It sets the following options:
- Trace level is displayed.
- Colored output is disabled.
- Module and function information is displayed.
- Timestamps are displayed.
- Thread ID is omitted.
- Nicer colors are disabled.
This is useful for writing to files, since you don't want the color codes.
This method allows you to set a custom writer function for handling trace messages. You can specify your own writer in the form
func writer(msg: String) -> void:-
writer(Callable): The custom writer function responsible for processing and outputting trace messages.
The TraceSubscriber class is designed to offer flexibility in customizing how trace messages are displayed and processed, allowing you to adapt the output to your specific debugging and monitoring requirements.