GLib.log_default_handler
function log_default_handler(log_domain: String, log_level: GLib.LogLevelFlags, message: String, unused_data: void): void {
// Gjs wrapper for g_log_default_handler()
}
The default log handler set up by GLib; GLib.log_set_default_handler allows to install an alternate default log handler. This is used if no log handler has been set for the particular log domain and log level combination. It outputs the message to stderr or stdout and if the log level is fatal it calls abort(). It automatically prints a new-line character after the message, so one does not need to be manually included in message.
The behavior of this log handler can be influenced by a number of environment variables:
- `G_MESSAGES_PREFIXED`: A :-separated list of log levels for which messages should be prefixed by the program name and PID of the aplication.
- `G_MESSAGES_DEBUG`: A space-separated list of log domains for which debug and informational messages are printed. By default these messages are not printed.
stderr is used for levels GLib.LogLevelFlags.level_error, GLib.LogLevelFlags.level_critical, GLib.LogLevelFlags.level_warning and GLib.LogLevelFlags.level_message. stdout is used for the rest.
- log_domain
the log domain of the message
- log_level
the level of the message
- message
the message
- unused_data
data passed from GLib.log which is unused