ArvernOS
Loading...
Searching...
No Matches
logging.h File Reference

This is the general kernel logging module. More...

#include <arch/logging.h>
#include <inttypes.h>
#include <stdio.h>
#include <time/timer.h>
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Macros

#define __LOG_TIMESTAMP_FORMAT   "[%3" PRIu64 ".%03" PRIu64 "%03" PRIu64 "] "
#define __LOG_STREAM(time_us, level, format, ...)
 Writes one log line to the structured logger (serial port).
#define __LOG(level, format, ...)
 Writes one log line, using the same timestamp for the whole message.

Detailed Description

This is the general kernel logging module.

In release mode, the logging levels available are:

  • INFO
  • WARN

In debug mode, the following additional logging levels are available:

  • DEBUG: enabled by default but can be disabled with ENABLE_KERNEL_DEBUG set to 0.

Each kernel module should ideally have its own logging header that depends on this one. The main use case is to have more configurable loggers that can be enabled/disabled depending on the needs.

Macro Definition Documentation

◆ __LOG_TIMESTAMP_FORMAT

#define __LOG_TIMESTAMP_FORMAT   "[%3" PRIu64 ".%03" PRIu64 "%03" PRIu64 "] "

Timestamp prefix ([seconds.microseconds]) shared by the structured logger and the console output. The seconds are right-aligned on 3 characters and the fractional part is zero-padded to 6 digits.