Dunst
Lightweight notification daemon
Loading...
Searching...
No Matches
log.c File Reference
#include <glib.h>
#include "log.h"
#include "utils.h"
+ Include dependency graph for log.c:

Go to the source code of this file.

Functions

static const char * log_level_to_string (GLogLevelFlags level)
 
void log_set_level_from_string (const char *level)
 Set the current loglevel to level
 
void log_set_level (GLogLevelFlags level)
 Set the current loglevel to level
 
static void dunst_log_handler (const gchar *log_domain, GLogLevelFlags message_level, const gchar *message, gpointer ignore)
 Log handling function for GLib's logging wrapper.
 
void dunst_log_init (enum log_mask mask)
 Initialise log handling.
 

Variables

static GLogLevelFlags log_level = G_LOG_LEVEL_MESSAGE
 
static enum log_mask log_mask = DUNST_LOG_AUTO
 

Detailed Description

License
BSD-3-Clause

Definition in file log.c.

Function Documentation

◆ dunst_log_handler()

static void dunst_log_handler ( const gchar * log_domain,
GLogLevelFlags message_level,
const gchar * message,
gpointer ignore )
static

Log handling function for GLib's logging wrapper.

Parameters
log_domainUsed only by GLib
message_levelUsed only by GLib
messageUsed only by GLib
ignore

Definition at line 71 of file log.c.

◆ dunst_log_init()

void dunst_log_init ( enum log_mask mask)

Initialise log handling.

Can be called any time.

Parameters
maskIf we're in testing mode and should suppress all output or show all

Definition at line 95 of file log.c.

◆ log_level_to_string()

static const char * log_level_to_string ( GLogLevelFlags level)
static

Definition at line 19 of file log.c.

◆ log_set_level()

void log_set_level ( GLogLevelFlags level)

Set the current loglevel to level

Parameters
levelThe desired log level

If level is NULL, nothing will be done. If level is an invalid value, nothing will be done.

Definition at line 58 of file log.c.

◆ log_set_level_from_string()

void log_set_level_from_string ( const char * level)

Set the current loglevel to level

Parameters
levelThe desired log level as a string

If level is NULL, nothing will be done. If level is an invalid value, nothing will be done.

Definition at line 32 of file log.c.

Variable Documentation

◆ log_level

GLogLevelFlags log_level = G_LOG_LEVEL_MESSAGE
static

Definition at line 15 of file log.c.

◆ log_mask

enum log_mask log_mask = DUNST_LOG_AUTO
static

Definition at line 17 of file log.c.