Skip to content

Print sources when DEBUG=* is set #17952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Upgrade: Automatically convert candidates with arbitrary values to their utilities ([#17831](https://github.com/tailwindlabs/tailwindcss/pull/17831), [#17854](https://github.com/tailwindlabs/tailwindcss/pull/17854))
- Write to log file when using `DEBUG=*` ([#17906](https://github.com/tailwindlabs/tailwindcss/pull/17906))
- Write to log file when using `DEBUG=*` ([#17906](https://github.com/tailwindlabs/tailwindcss/pull/17906), [#17952](https://github.com/tailwindlabs/tailwindcss/pull/17952))
- Add support for source maps in development ([#17775](https://github.com/tailwindlabs/tailwindcss/pull/17775))

### Fixed
Expand Down
17 changes: 16 additions & 1 deletion crates/oxide/src/scanner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,24 @@ pub struct Scanner {

impl Scanner {
pub fn new(sources: Vec<PublicSourceEntry>) -> Self {
init_tracing();

if *SHOULD_TRACE {
event!(tracing::Level::INFO, "Provided sources:");
for source in &sources {
event!(tracing::Level::INFO, "Source: {:?}", source);
}
}

let sources = Sources::new(public_source_entries_to_private_source_entries(sources));

if *SHOULD_TRACE {
event!(tracing::Level::INFO, "Optimized sources:");
for source in sources.iter() {
event!(tracing::Level::INFO, "Source: {:?}", source);
}
}

Self {
sources: sources.clone(),
walker: create_walker(sources),
Expand All @@ -163,7 +179,6 @@ impl Scanner {
}

pub fn scan(&mut self) -> Vec<String> {
init_tracing();
self.scan_sources();

// TODO: performance improvement, bail early if we don't have any changed content
Expand Down