fugle-marketdata-core 0.7.3

Internal kernel for the Fugle market data SDK. End users should depend on `fugle-marketdata` instead.
Documentation
//! Tracing compatibility layer.
//!
//! Re-exports `tracing`'s `debug!`, `info!`, `warn!`, `error!` macros when
//! the `tracing` feature is enabled and provides no-op stand-ins when it
//! is not. Callers `use crate::tracing_compat::{debug, info, warn, error}`
//! and write feature-agnostic code; the no-op variants compile to nothing.
//!
//! The `#[tracing::instrument(...)]` attribute is gated separately at the
//! call site via `#[cfg_attr(feature = "tracing", tracing::instrument(...))]`
//! because attributes cannot be re-exported.
//!
//! # Internal-only `__tracing_noop` macro
//!
//! When the `tracing` feature is **disabled**, the no-op fallback defines a
//! `__tracing_noop` macro at the crate root using `#[macro_export]`. This
//! is necessary because `macro_rules!` has no other mechanism for
//! cross-module visibility — `pub(crate) macro_rules!` is not valid syntax
//! and module-scoped `macro_rules!` cannot be `use`d from sibling modules.
//!
//! `__tracing_noop` carries `#[doc(hidden)]` and the leading-underscore name
//! signals internal-use-only. **It is NOT part of the public API.** Downstream
//! consumers MUST NOT depend on it; its name, signature, or existence may
//! change without a semver bump — in particular when the `tracing` crate
//! ships a major-version upgrade that changes its own macro shape.
//!
//! The `cargo public-api` snapshot in `core/PUBLIC-API.txt` (regenerated by
//! `core/tests/public_api_snapshot.rs`) tracks `tracing_compat`-adjacent
//! symbols so accidental surface expansion trips CI.

#[cfg(feature = "tracing")]
pub(crate) use tracing::{debug, error, info, warn};

#[cfg(not(feature = "tracing"))]
mod noop {
    /// Internal no-op macro. Crate-root export is forced by `macro_rules!`
    /// visibility rules — see the module-level note in `tracing_compat.rs`.
    /// **Not public API.** Do not use.
    #[macro_export]
    #[doc(hidden)]
    macro_rules! __tracing_noop {
        ($($_:tt)*) => {};
    }

    pub(crate) use crate::__tracing_noop as debug;
    pub(crate) use crate::__tracing_noop as error;
    pub(crate) use crate::__tracing_noop as info;
    pub(crate) use crate::__tracing_noop as warn;
}

#[cfg(not(feature = "tracing"))]
#[allow(unused_imports, reason = "consumers of individual macros are gated on other features")]
pub(crate) use noop::{debug, error, info, warn};