Files
zed/crates/ztracing/src/lib.rs
Yara 🏳️‍⚧️ 1446d84941 Blockmap sync fix (#44743)
Release Notes:

- Improved display map rendering performance with many lines in the the multi-buffer.

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Cole Miller <cole@zed.dev>
2025-12-17 16:14:57 +00:00

59 lines
1.3 KiB
Rust

pub use tracing::{Level, field};
#[cfg(ztracing)]
pub use tracing::{
Span, debug_span, error_span, event, info_span, instrument, span, trace_span, warn_span,
};
#[cfg(not(ztracing))]
pub use ztracing_macro::instrument;
#[cfg(not(ztracing))]
pub use __consume_all_tokens as trace_span;
#[cfg(not(ztracing))]
pub use __consume_all_tokens as info_span;
#[cfg(not(ztracing))]
pub use __consume_all_tokens as debug_span;
#[cfg(not(ztracing))]
pub use __consume_all_tokens as warn_span;
#[cfg(not(ztracing))]
pub use __consume_all_tokens as error_span;
#[cfg(not(ztracing))]
pub use __consume_all_tokens as event;
#[cfg(not(ztracing))]
pub use __consume_all_tokens as span;
#[cfg(not(ztracing))]
#[macro_export]
macro_rules! __consume_all_tokens {
($($t:tt)*) => {
$crate::Span
};
}
#[cfg(not(ztracing))]
pub struct Span;
#[cfg(not(ztracing))]
impl Span {
pub fn current() -> Self {
Self
}
pub fn enter(&self) {}
pub fn record<T, S>(&self, _t: T, _s: S) {}
}
#[cfg(ztracing)]
pub fn init() {
zlog::info!("Starting tracy subscriber, you can now connect the profiler");
use tracing_subscriber::prelude::*;
tracing::subscriber::set_global_default(
tracing_subscriber::registry().with(tracing_tracy::TracyLayer::default()),
)
.expect("setup tracy layer");
}
#[cfg(not(ztracing))]
pub fn init() {}