|
PatchworkOS
|
#include <kernel/log/log.h>#include <kernel/cpu/cpu.h>#include <kernel/cpu/smp.h>#include <kernel/drivers/com.h>#include <kernel/log/log_file.h>#include <kernel/log/log_screen.h>#include <kernel/sched/timer.h>#include <kernel/sync/lock.h>#include <boot/boot_info.h>#include <kernel/version.h>#include <stdarg.h>#include <stdint.h>#include <stdio.h>#include <sys/io.h>#include <sys/proc.h>Go to the source code of this file.
Functions | |
| static void | log_splash (void) |
| void | log_init (const boot_gop_t *gop) |
| Initialize the logging system. | |
| void | log_screen_enable () |
| Enable logging to the screen. | |
| void | log_screen_disable (void) |
| Disable logging to the screen. | |
| void | log_write (const char *string, uint64_t length) |
| Write directly to the log outputs without any formatting or headers. | |
| static void | log_print_header (log_level_t level, const char *prefix) |
| static void | log_handle_char (log_level_t level, const char *prefix, char chr) |
| uint64_t | log_print (log_level_t level, const char *prefix, const char *format,...) |
| Print a formatted log message. | |
| uint64_t | log_vprint (log_level_t level, const char *prefix, const char *format, va_list args) |
| Print a formatted log message with a va_list. | |
Variables | |
| static lock_t | lock = LOCK_CREATE |
| static char | lineBuffer [LOG_MAX_BUFFER] = {0} |
| static char | workingBuffer [LOG_MAX_BUFFER] = {0} |
| static log_output_t | outputs = 0 |
| static log_level_t | minLevel = 0 |
| static bool | isLastCharNewline = 0 |
| static bool | firstHeaderPrinted = false |
| static const char * | levelNames [] |
|
static |
Definition at line 142 of file log.c.
References isLastCharNewline, log_print_header(), and log_write().
Referenced by log_vprint().
|
static |
Definition at line 113 of file log.c.
References CLOCKS_PER_SEC, firstHeaderPrinted, cpu_t::id, levelNames, LOG_LEVEL_PANIC, log_write(), NULL, smp_self_unsafe(), sprintf(), timer_uptime(), uptime(), and workingBuffer.
Referenced by log_handle_char().
|
static |
Definition at line 38 of file log.c.
References levelNames, LOG_INFO, LOG_OUTPUT_FILE, LOG_OUTPUT_SCREEN, LOG_OUTPUT_SERIAL, minLevel, and outputs.
Referenced by log_init().
Definition at line 27 of file log.c.
Referenced by log_print_header().
|
static |
Definition at line 26 of file log.c.
Referenced by log_handle_char(), and log_init().
|
static |
Definition at line 29 of file log.c.
Referenced by log_print_header(), and log_splash().
|
static |
Definition at line 22 of file log.c.
Referenced by config_open(), and log_vprint().
|
static |
Definition at line 20 of file log.c.
Referenced by log_screen_disable(), log_screen_enable(), and log_vprint().
|
static |
Definition at line 25 of file log.c.
Referenced by log_init(), log_splash(), and log_vprint().
|
static |
Definition at line 24 of file log.c.
Referenced by log_init(), log_screen_disable(), log_screen_enable(), log_splash(), and log_write().
|
static |
Definition at line 23 of file log.c.
Referenced by log_print_header().