LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
log.c File Reference

Logging utilities for the kernel. More...

#include <kernel/kprintf.h>
#include <lib/kstring.h>
#include <kernel/log.h>
Include dependency graph for log.c:

Go to the source code of this file.

Functions

void klog (int level,...)
 Formats a string to hold a logging level and print it.
void set_debug_on (bool is_on)
 Sets the debug mode.
bool get_debug_on (void)
 Gets the current value of LOG_ENABLE_DEBUG.

Variables

static bool LOG_ENABLE_DEBUG = false
 Should the logging util print Debug statements.
int LOGGING_LEVEL = LOG_LEVEL_INFO

Detailed Description

Logging utilities for the kernel.

Author
Matheus Boscariol
Since
02/11/2026

Definition in file log.c.

Function Documentation

◆ get_debug_on()

bool get_debug_on ( void )

Gets the current value of LOG_ENABLE_DEBUG.

Returns
Is the util printing debug statements

Definition at line 70 of file log.c.

◆ klog()

void klog ( int level,
... )

Formats a string to hold a logging level and print it.

Parameters
levelThe logging level to print as (info, warn, error, debug)
...The format string and its arguments

Definition at line 17 of file log.c.

Here is the call graph for this function:

◆ set_debug_on()

void set_debug_on ( bool is_on)

Sets the debug mode.

Parameters
is_onShould the util print debug statements?

Definition at line 66 of file log.c.

Variable Documentation

◆ LOG_ENABLE_DEBUG

bool LOG_ENABLE_DEBUG = false
static

Should the logging util print Debug statements.

Definition at line 14 of file log.c.

◆ LOGGING_LEVEL

int LOGGING_LEVEL = LOG_LEVEL_INFO

Definition at line 15 of file log.c.