GLib.log_default_handler (original) (raw)

Function

GLiblog_default_handler

Declaration [src]


void
g_log_default_handler (
  const gchar* log_domain,
  GLogLevelFlags log_level,
  const gchar* message,
  gpointer unused_data
)

Description [src]

The default log handler set up by GLib; g_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 stderror stdout and if the log level is fatal it calls G_BREAKPOINT(). 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:

stderr is used for levels G_LOG_LEVEL_ERROR,G_LOG_LEVEL_CRITICAL, G_LOG_LEVEL_WARNING andG_LOG_LEVEL_MESSAGE. stdout is used for the rest, unless stderr was requested byg_log_writer_default_set_use_stderr().

This has no effect if structured logging is enabled; seeUsing Structured Logging.

Parameters

log_domain

Type: const gchar*

The log domain of the message, or NULL for the default "" application domain.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

log_level

Type: GLogLevelFlags

The level of the message.

message

Type: const gchar*

The message.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

unused_data

Type: gpointer

Data passed from g_log() which is unused.

The argument can be NULL.
The data is owned by the caller of the function.