98 lines
3.4 KiB
Rust
98 lines
3.4 KiB
Rust
// file: crates/ksp-logging-lib/src/macros.rs
|
|
// version: 1
|
|
|
|
/// Emits a KSP error event with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! error {
|
|
(target: $target:expr, $($argument:tt)+) => {{
|
|
$crate::__private_tracing::error!(target: $target, $($argument)+);
|
|
}};
|
|
}
|
|
|
|
/// Emits a KSP warning event with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! warn {
|
|
(target: $target:expr, $($argument:tt)+) => {{
|
|
$crate::__private_tracing::warn!(target: $target, $($argument)+);
|
|
}};
|
|
}
|
|
|
|
/// Emits a KSP informational event with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! info {
|
|
(target: $target:expr, $($argument:tt)+) => {{
|
|
$crate::__private_tracing::info!(target: $target, $($argument)+);
|
|
}};
|
|
}
|
|
|
|
/// Emits a KSP debug event with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! debug {
|
|
(target: $target:expr, $($argument:tt)+) => {{
|
|
$crate::__private_tracing::debug!(target: $target, $($argument)+);
|
|
}};
|
|
}
|
|
|
|
/// Emits a KSP trace event with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! trace {
|
|
(target: $target:expr, $($argument:tt)+) => {{
|
|
$crate::__private_tracing::trace!(target: $target, $($argument)+);
|
|
}};
|
|
}
|
|
|
|
/// Creates a KSP error span with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! error_span {
|
|
(target: $target:expr, $name:expr) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::error_span!(target: $target, $name))
|
|
}};
|
|
(target: $target:expr, $name:expr, $($field:tt)+) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::error_span!(target: $target, $name, $($field)+))
|
|
}};
|
|
}
|
|
|
|
/// Creates a KSP warning span with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! warn_span {
|
|
(target: $target:expr, $name:expr) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::warn_span!(target: $target, $name))
|
|
}};
|
|
(target: $target:expr, $name:expr, $($field:tt)+) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::warn_span!(target: $target, $name, $($field)+))
|
|
}};
|
|
}
|
|
|
|
/// Creates a KSP informational span with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! info_span {
|
|
(target: $target:expr, $name:expr) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::info_span!(target: $target, $name))
|
|
}};
|
|
(target: $target:expr, $name:expr, $($field:tt)+) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::info_span!(target: $target, $name, $($field)+))
|
|
}};
|
|
}
|
|
|
|
/// Creates a KSP debug span with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! debug_span {
|
|
(target: $target:expr, $name:expr) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::debug_span!(target: $target, $name))
|
|
}};
|
|
(target: $target:expr, $name:expr, $($field:tt)+) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::debug_span!(target: $target, $name, $($field)+))
|
|
}};
|
|
}
|
|
|
|
/// Creates a KSP trace span with an explicit owning target.
|
|
#[macro_export]
|
|
macro_rules! trace_span {
|
|
(target: $target:expr, $name:expr) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::trace_span!(target: $target, $name))
|
|
}};
|
|
(target: $target:expr, $name:expr, $($field:tt)+) => {{
|
|
$crate::Span::__from_tracing($crate::__private_tracing::trace_span!(target: $target, $name, $($field)+))
|
|
}};
|
|
}
|