PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
log.h File Reference
#include <sys/defs.h>
#include <boot/boot_info.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/fs.h>
#include <sys/math.h>
#include <sys/proc.h>
Include dependency graph for log.h:

Go to the source code of this file.

Macros

#define LOG_MAX_BUFFER   0x1000
 Maximum buffer size for various logging buffers.
 
#define LOG_DEBUG(format, ...)   log_print(LOG_LEVEL_DEBUG, format __VA_OPT__(, ) __VA_ARGS__)
 
#define LOG_USER(format, ...)   log_print(LOG_LEVEL_USER, format __VA_OPT__(, ) __VA_ARGS__)
 
#define LOG_INFO(format, ...)   log_print(LOG_LEVEL_INFO, format __VA_OPT__(, ) __VA_ARGS__)
 
#define LOG_WARN(format, ...)   log_print(LOG_LEVEL_WARN, format __VA_OPT__(, ) __VA_ARGS__)
 
#define LOG_ERR(format, ...)   log_print(LOG_LEVEL_ERR, format __VA_OPT__(, ) __VA_ARGS__)
 
#define LOG_PANIC(format, ...)   log_print(LOG_LEVEL_PANIC, format __VA_OPT__(, ) __VA_ARGS__)
 

Enumerations

enum  log_level_t {
  LOG_LEVEL_DEBUG , LOG_LEVEL_USER , LOG_LEVEL_INFO , LOG_LEVEL_WARN ,
  LOG_LEVEL_ERR , LOG_LEVEL_PANIC
}
 Log levels. More...
 

Functions

void log_init (void)
 Initialize the logging system.
 
void log_expose (void)
 Expose kernel logs via the /dev/klog file.
 
void log_nprint (log_level_t level, const char *string, uint64_t length)
 Print a unformatted log message.
 
void log_print (log_level_t level, const char *format,...)
 Print a formatted log message.
 
void log_vprint (log_level_t level, const char *format, va_list args)
 Print a formatted log message with a va_list.