GLibLogLogger

class GLibLogLogger(minPriority: LogPriority = LogPriority.DEBUG) : LogLogger

A LogLogger implementation that uses GLib's g_log for logging.

This logger integrates with GLib's logging system and supports GLib log levels.

Key Features

  • Automatically enables DEBUG and INFO log levels if the minimum priority is set below MESSAGE.

  • Logs messages directly using g_log.

  • Honors GLib's G_MESSAGES_DEBUG environment variable for enabling lower-level log messages.

Installation

This logger can be installed conditionally:

Parameters

minPriority

The minimum log priority to log. Default is LogPriority.DEBUG. Setting it below LogPriority.MESSAGE will enable DEBUG and INFO levels.

Constructors

Link copied to clipboard
constructor(minPriority: LogPriority = LogPriority.DEBUG)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun isLoggable(priority: LogPriority): Boolean

Returns true if the given priority is at least as severe as minPriority.

Link copied to clipboard
open override fun log(priority: LogPriority, logDomain: String, message: String)

Logs the given message at the specified priority and logDomain using GLib's g_log.