-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Write to log file when using DEBUG=*
#17906
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
Conversation
b40a683
to
1fe008d
Compare
This log happens when we are traversing using the gitignore walker
DEBUG=*
DEBUG=*
- Don't scan files for utilities when using `@reference` ([#17836](https://github.com/tailwindlabs/tailwindcss/pull/17836)) | ||
- Fix incorrectly replacing `_` with ` ` in arbitrary modifier shorthand `bg-red-500/(--my_opacity)` ([#17889](https://github.com/tailwindlabs/tailwindcss/pull/17889)) | ||
- Upgrade: Bump dependendencies in parallel and make the upgrade faster ([#17898](https://github.com/tailwindlabs/tailwindcss/pull/17898)) | ||
- Upgrade: Bump dependencies in parallel and make the upgrade faster ([#17898](https://github.com/tailwindlabs/tailwindcss/pull/17898)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤫
This allows us to: 1. Only output the header once 2. Output a log from Oxide that will end up underneath the header
Is there a way to debug the scanner with Vite? This here seems to be for Tailwind CLI only? |
@NickSdot |
You are right. Apparently I missed something this morning, my bad. Thanks for the quick answer! 🙏 |
This PR improves the debugability of the scanner when using
DEBUG=*
by writing to atailwindcss-{pid}.log
file in the current working directory.It will include all the tracing information from the scanner. This PR also introduces
Discovering {path}
andReading {path}
logs.Discovering {path}
— this is logged when we are traversing the file system looking for files. We use theignore
crate, and log this information in thefilter_entry
callback. If a file was already ignored by.gitignore
files, this won't show up, but it also means that we will not read it.Reading {path}
— this is when we are actually reading the file so we can start extracting potential Tailwind CSS classes.These will give you some insights in what paths are being scanned, and if we get stuck, where we get stuck.
Also, we are appending to the file. In the log below, you can already see that a
tailwindcss-<number>.log
file exists already even though it didn't exist before running the command. This should make it easier to debug if we get stuck on a specific file/folder because the file will be populated with information.There are a few reasons for appending to a file:
@source
directives, you could diff the outputs. (although, the timestamps will be different)DEBUG=*
, a lot of other tools also output debug information, so writing to a file should make this better.Example log
We also output where we are writing the file to. This looks like this when using the CLI:

Last but not least, this also ignores
.log
files by defaultTest plan
Ran the CLI (but you can use any tool real, since this is implemented in Oxide) with the
DEBUG=*
flag.The file generated, looks like the example I shared above.