-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Hono Logger ("hono/logger") Disable Coloring #3751
Comments
I was going to raise a feature request related to disabling status code coloring too! The Debug Console in VS Code does not support the ANSI escape codes that are used to add the colors, so the output looks like Looking through the source code, I found the same thing that @kingmesal did: to disable status code coloring, you can set a "NO_COLOR" environment variable, which is described at https://no-color.org/. The way to get coloring working in the VS Code Debug Console (rather than disabling it) was to add For @kingmesal's original problem... I haven't written code to run on CloudFlare Workers before (so this might be a bad work-around), but I understand that they have an empty |
Wow, interesting idea! This is okay, and we are working on another solution. |
Thanks for implementing this. This is a huge saver, especially when logging to files and not having to postprocess the logs with regex. |
Am I reading the If so, that in and of itself solves turning coloring off in Cloudflare, right. Otherwise, if not, having to turn on nodejs_compat to set an env is kind of a terribly obscure approach. |
What is the feature you are proposing?
Currently the color status coding is set with this:
const isNoColor = typeof Deno?.noColor === "boolean" ? Deno.noColor : process !== void 0 ? "NO_COLOR" in process?.env : false;
Can something be added to check it this is running in a cloudflare worker to disable coloring?
My logs spit out
�[32m200�[0m 923ms
, which is terrible.The
c.env
could be passed in and ifNO_COLOR === true
then we are set.The text was updated successfully, but these errors were encountered: