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

Logging utilities for the kernel. More...

#include <kernel/kprintf.h>
#include <lib/kstring.h>
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LOG_INFO(...)
#define LOG_WARN(...)
#define LOG_ERROR(...)
#define LOG_DEBUG(...)

Enumerations

enum  log_level { LOG_LEVEL_ERROR , LOG_LEVEL_WARN , LOG_LEVEL_INFO , LOG_LEVEL_DEBUG }
 The logging levels for the log utility. More...

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

int LOGGING_LEVEL

Detailed Description

Logging utilities for the kernel.

Author
Matheus Boscariol
Since
02/11/2026

Definition in file log.h.

Macro Definition Documentation

◆ LOG_DEBUG

#define LOG_DEBUG ( ...)
Value:
klog(LOG_LEVEL_DEBUG, __VA_ARGS__)
void klog(int level,...)
Formats a string to hold a logging level and print it.
Definition log.c:17

Definition at line 28 of file log.h.

◆ LOG_ERROR

#define LOG_ERROR ( ...)
Value:
klog(LOG_LEVEL_ERROR, __VA_ARGS__)

Definition at line 27 of file log.h.

◆ LOG_INFO

#define LOG_INFO ( ...)
Value:
klog(LOG_LEVEL_INFO, __VA_ARGS__)

Definition at line 25 of file log.h.

◆ LOG_WARN

#define LOG_WARN ( ...)
Value:
klog(LOG_LEVEL_WARN, __VA_ARGS__)

Definition at line 26 of file log.h.

Enumeration Type Documentation

◆ log_level

enum log_level

The logging levels for the log utility.

Definition at line 16 of file log.h.

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

◆ LOGGING_LEVEL

int LOGGING_LEVEL
extern

Definition at line 15 of file log.c.