feat: 编译管线/类型层 crate 补全多级日志宏 + 关键路径日志

This commit is contained in:
爱特每羊队
2026-08-10 17:56:28 +08:00
parent 61898f8983
commit d3ed1113ef
34 changed files with 421 additions and 1 deletions
+1
View File
@@ -7,6 +7,7 @@ rust-version.workspace = true
description = "OxideJS - JavaScript parser (oxc_parser re-export)"
[dependencies]
oxide_log = { path = "../oxide_log" }
oxc_parser.workspace = true
oxc_allocator.workspace = true
oxc_ast.workspace = true
+1
View File
@@ -1,6 +1,7 @@
#![doc = "OxideJS - JavaScript parser (oxc_parser re-export)"]
mod error;
mod parser_log;
/// 解析错误:消息 + 源文件字节区间(起始,结束)。
pub use error::OxideError;
+37
View File
@@ -0,0 +1,37 @@
//! parser 日志宏:`parser_error!/warn!/info!/debug!/trace!`,经由 oxide_log 上报。
//! 编译管线属 Kernel 子系统,`OXIDE_LOG=oxide::kernel=debug` 控制本 crate 日志。
#[macro_export]
macro_rules! parser_error {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::ERROR, $($arg)*)
};
}
#[macro_export]
macro_rules! parser_warn {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::WARN, $($arg)*)
};
}
#[macro_export]
macro_rules! parser_info {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::INFO, $($arg)*)
};
}
#[macro_export]
macro_rules! parser_debug {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::DEBUG, $($arg)*)
};
}
#[macro_export]
macro_rules! parser_trace {
($($arg:tt)*) => {
oxide_log::__log_event!("oxide::kernel", oxide_log::tracing::Level::TRACE, $($arg)*)
};
}