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

docs: how to disable status code coloring in logger middleware #553

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

StuartMoncrieff
Copy link

@StuartMoncrieff StuartMoncrieff commented Dec 20, 2024

Added a tip on how to disable status code coloring for the built-in logger's output by setting the NO_COLOR environment variable.

Also added a link to Pino logging middleware for Hono (as an alternative to the built-in logger middleware).

@StuartMoncrieff StuartMoncrieff changed the title docs(middleware/third-party): added a link to Pino logging middleware for Hono docs: how to disable status code coloring in logger middleware Dec 20, 2024
@@ -31,6 +31,11 @@ By using the Logger Middleware, you can easily monitor the flow of requests and

You can also extend the middleware further by providing your own `PrintFunc` function for tailored logging behavior.

::: tip

To disable _status code coloring_, you can set a `NO_COLOR` environment variable. This is a common way to disable ANSI color escape codes in logging libraries, and is described at <https://no-color.org/>. Note that CloudFlare Workers do not have a `process.env` object, so will default to plaintext log output.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CloudFlare Workers should be Cloudflare Workers (f is lowercase).

@yusukebe
Copy link
Member

Hi @StuartMoncrieff

Thank you for the PR! I've added the comment.

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 this pull request may close these issues.

2 participants