feat: 编译管线/类型层 crate 补全多级日志宏 + 关键路径日志
This commit is contained in:
@@ -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,6 +1,7 @@
|
||||
#![doc = "OxideJS - JavaScript parser (oxc_parser re-export)"]
|
||||
|
||||
mod error;
|
||||
mod parser_log;
|
||||
|
||||
/// 解析错误:消息 + 源文件字节区间(起始,结束)。
|
||||
pub use error::OxideError;
|
||||
|
||||
@@ -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)*)
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user