itrace 0.1.1

Structured, columnar tracing for Rust applications
Documentation
// Copyright (c) 2026 Claudio Carraro <wiclac@pm.me>
// SPDX-License-Identifier: BSD-3-Clause

/// Formatta il timestamp corrente usando il formato specificato.
/// Il backend (jiff o chrono) รจ selezionato dalla feature attiva.
pub fn format_now(fmt: &str) -> String {
    #[cfg(feature = "jiff")]
    {
        use jiff::Zoned;
        Zoned::now().strftime(fmt).to_string()
    }

    #[cfg(all(feature = "chrono", not(feature = "jiff")))]
    {
        use chrono::Local;
        Local::now().format(fmt).to_string()
    }

    #[cfg(not(any(feature = "jiff", feature = "chrono")))]
    {
        compile_error!(
            "itrace: devi attivare almeno una feature tra 'jiff' e 'chrono'. \
             Aggiungi 'features = [\"jiff\"]' nella dipendenza itrace."
        );
    }
}