Files
Deshab-OS/CODE/UTSM/include/utsm/log.h
T
Linehu 3aa15e7b21 feat: D4 DKM colored log prefixes - every driver has its own temper
- log.c: color context (log_set_color / log_color_enable); ANSI only goes to serial, BOOTLOG.TXT buffer stays clean plain text
- kernel_api.c: dkm_log_set_driver() — driver-name FNV-1a hash into an 8-color bright ANSI palette, deterministic per driver
- load sites (dkm_core builtin + boot_modules external) set color around driver_init and clear after
- FUCK [debug] color_log gate (dev=1, release=0)
- QEMU verified: 1150 colored lines, per-driver stable colors (.build_tmp/qemu_serial_d4color.log)
2026-10-02 19:48:54 +08:00

30 lines
915 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef UTSM_LOG_H
#define UTSM_LOG_H
#include <utsm/types.h>
void serial_init(void);
void serial_putc(char c);
void serial_write(const char *s);
void log_info(const char *msg);
void log_warn(const char *msg);
void log_error(const char *msg);
void log_hex64(const char *prefix, u64 value);
void panic(const char *msg);
/* D4: DKM 彩色日志——驱动 init 期间的颜色上下文。
* log_set_color 传 ANSI CSI(如 "\x1b[36m"),0/"" 恢复默认;
* 颜色只走串口,BOOTLOG 缓冲保持纯文本。log_color_enable 总开关
* (FUCK [debug] color_log)。 */
void log_set_color(const char *ansi);
void log_color_enable(int enable);
/* ---- 内存日志缓冲区(实机启动日志持久化) ----
* 由 disk_log_flush() 写入 FAT32 文件 SYSTEM/DESHAB64/DEV/BOOTLOG.TXT。 */
void log_capture_enable(int enable);
const char *log_get_buffer(void);
u32 log_get_length(void);
#endif