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 OxideCore Scanner calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  220d6d8d_14c9_3b64_e1b2_32087c764f91["init_tracing()"]
  fc9cb72c_75d6_6080_97ee_d75864020703["new()"]
  fc9cb72c_75d6_6080_97ee_d75864020703 -->|calls| 220d6d8d_14c9_3b64_e1b2_32087c764f91
  3f7e4f51_16f6_29fc_5eb2_94b12aca879e["dim()"]
  220d6d8d_14c9_3b64_e1b2_32087c764f91 -->|calls| 3f7e4f51_16f6_29fc_5eb2_94b12aca879e
  e48d4ef7_5977_c401_24dd_5337fdfa3267["highlight()"]
  220d6d8d_14c9_3b64_e1b2_32087c764f91 -->|calls| e48d4ef7_5977_c401_24dd_5337fdfa3267
  style 220d6d8d_14c9_3b64_e1b2_32087c764f91 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