Suggestion: Use stderr for diagnostic output instead of stdout #4318
danidb
started this conversation in
Ideas / feature requests
Replies: 1 comment
-
|
This is neither a warning nor an error. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
DaisyUI is awesome, good times. Thank you. A "DX"-ish suggestion:
I've had issues in toolchains with prettier-plugin-tailwindcss and similar steps that involve stdout/stdin and trigger (somehow) the logging in daisyUI, locally and in CI. My issues are similar to those linked below. DaisyUI's logging was problematic for me because tools will expect stdout to only contain program output...but I didn't want to turn off the logs.
tailwindlabs/tailwindcss#8380
#1413
To keep logs available in the terminal but avoid issues with tools that work on stdin/stdout, it's common/conventional to send diagnostic or debug logs to stderr instead. Node sends console.log to stdout and console.error/console.warn to stderr so I usually just patch this behavior by swapping out the problematic console.log in daisyUI for a console.error/warn on my end with patch-package and that takes care of it.
Can gladly contribute/PR. Cheers.
Beta Was this translation helpful? Give feedback.
All reactions