Skip to content
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

DEBUG environment variable #6769

Closed
arcanis opened this issue Dec 28, 2021 · 1 comment · Fixed by #6797
Closed

DEBUG environment variable #6769

arcanis opened this issue Dec 28, 2021 · 1 comment · Fixed by #6797

Comments

@arcanis
Copy link

arcanis commented Dec 28, 2021

What version of Tailwind CSS are you using?

2.x, 3.x

What build tool (or framework if it abstracts the build tool) are you using?

n/a

What version of Node.js are you using?

n/a

What browser are you using?

n/a

What operating system are you using?

n/a

Reproduction URL

Any project can be used to reproduce the issue. Just add DEBUG=something in the environment.

Describe your issue

The JS ecosystem, pushed by the debug package (625M dl / month 🔥), defined the DEBUG environment variable as a comma-separated list of tags. This lets multiple tools write their own debug messages, letting the user pick the ones they want to show.

Tailwind doesn't follow this pattern (it just checks whether the value is anything other than 0), causing Tailwind to print a large amount of unwanted logs if we attempt to print debug logs for anything else.

For instance, I get the following logs after each rebuild in a Next.js application (which I run with DEBUG='postgraphile:*' in order to get some debug information I care about); as you can see, two lines are for Webpack, and 22 are for Tailwind:

image

Tailwind should instead respect the DEBUG comma-separated-tags convention, and only print debug logs if DEBUG contains something tailwind in its tags (ie DEBUG=tailwind, DEBUG=postgraphile,tailwind, etc).

@RobinMalfait
Copy link
Contributor

Hey! Thank you for your suggestion!
Much appreciated! 🙏

I've added a PR that improves the parsing of the DEBUG environment variable.
It will be available in the next version, but you can already try it using the @insiders build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants