kiba-engine
Functions
log.c File Reference

Logging system implementation. More...

#include <kiba/core/log.h>
#include <kiba/core/memory.h>
#include <kiba/format/format.h>
#include <kiba/platform/console.h>
Include dependency graph for log.c:

Go to the source code of this file.

Functions

void enable_stacktraces (log_level level)
 Enables output of the stacktrace. More...
 
void disable_stacktraces (void)
 Disables output of the stacktrace.
 
void log_set_active_level (log_level level)
 Set the minimum log level to log. More...
 
void write_log_entry (log_level level, const char *file, long int line, const char *msg,...)
 Create log entry and write to output channel. More...
 
void write_to_console (log_level level, const char *msg)
 Write string to console. More...
 

Detailed Description

Logging system implementation.

Definition in file log.c.

Function Documentation

◆ enable_stacktraces()

void enable_stacktraces ( log_level  level)

Enables output of the stacktrace.

Stacktrace output is enabled for all logging calls equal or more severe than the level provided.

Parameters
levelthe highest level to enable stacktrace logging for

Definition at line 25 of file log.c.

◆ log_set_active_level()

void log_set_active_level ( log_level  level)

Set the minimum log level to log.

Every log call with this or a more severe level will be logged.

Parameters
levelthe minimum level to set

Definition at line 29 of file log.c.

◆ write_log_entry()

void write_log_entry ( log_level  level,
const char *  file,
long int  line,
const char *  msg,
  ... 
)

Create log entry and write to output channel.

Parameters
levelseverity of the entry
filepath to the file the entry was created in
lineline in the file the entry was created in
msglog message, can contain format character sequences
...arguments to be used for formatting

Definition at line 31 of file log.c.

◆ write_to_console()

void write_to_console ( log_level  level,
const char *  msg 
)

Write string to console.

Parameters
levelseverity of the entry
msglog entry

Definition at line 49 of file log.c.