Home / Function/ init_tracing() — tailwindcss Function Reference

init_tracing() — tailwindcss Function Reference

Architecture documentation for the init_tracing() function in mod.rs from the tailwindcss codebase.

Function rust RustCore FileScanner calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  878f6a0e_ea74_3ea2_ad17_27f64191747d["init_tracing()"]
  4db59ffb_dcea_b3bb_bddb_1c20bbe5b635["new()"]
  4db59ffb_dcea_b3bb_bddb_1c20bbe5b635 -->|calls| 878f6a0e_ea74_3ea2_ad17_27f64191747d
  5452c671_f140_9758_3733_261668eaa9ff["dim()"]
  878f6a0e_ea74_3ea2_ad17_27f64191747d -->|calls| 5452c671_f140_9758_3733_261668eaa9ff
  2c28541e_ab22_5170_2fac_7d3ceef403a2["highlight()"]
  878f6a0e_ea74_3ea2_ad17_27f64191747d -->|calls| 2c28541e_ab22_5170_2fac_7d3ceef403a2
  style 878f6a0e_ea74_3ea2_ad17_27f64191747d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/oxide/src/scanner/mod.rs lines 53–88

fn init_tracing() {
    if !*SHOULD_TRACE {
        return;
    }

    let file_path = format!("tailwindcss-{}.log", std::process::id());
    let file = OpenOptions::new()
        .create(true)
        .append(true)
        .open(&file_path)
        .unwrap_or_else(|_| panic!("Failed to open {file_path}"));

    let file_path = Path::new(&file_path);
    let absolute_file_path = dunce::canonicalize(file_path)
        .unwrap_or_else(|_| panic!("Failed to canonicalize {file_path:?}"));
    eprintln!(
        "{} Writing debug info to: {}\n",
        dim("[DEBUG]"),
        highlight(absolute_file_path.as_path().to_str().unwrap())
    );

    let file = Arc::new(Mutex::new(file));

    let writer: BoxMakeWriter = BoxMakeWriter::new({
        let file = file.clone();
        move || Box::new(MutexWriter(file.clone())) as Box<dyn Write + Send>
    });

    _ = tracing_subscriber::fmt()
        .with_max_level(tracing::Level::INFO)
        .with_span_events(tracing_subscriber::fmt::format::FmtSpan::ACTIVE)
        .with_writer(writer)
        .with_ansi(false)
        .compact()
        .try_init();
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does init_tracing() do?
init_tracing() is a function in the tailwindcss codebase.
What does init_tracing() call?
init_tracing() calls 2 function(s): dim, highlight.
What calls init_tracing()?
init_tracing() is called by 1 function(s): new.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free