From e1fb283fad6e34daa4243bde359ab7b0090c6aaa Mon Sep 17 00:00:00 2001 From: Stuart Moncrieff Date: Fri, 20 Dec 2024 13:58:25 +1100 Subject: [PATCH 1/2] docs(middleware/third-party): Pino is a more configurable alternative to the built-in logger --- docs/middleware/third-party.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/middleware/third-party.md b/docs/middleware/third-party.md index 82d2491..6daa5dd 100644 --- a/docs/middleware/third-party.md +++ b/docs/middleware/third-party.md @@ -47,3 +47,4 @@ Most of this middleware leverages external libraries. - [Geo](https://github.com/ktkongtong/hono-geo-middleware/tree/main/packages/middleware) - [Hono Simple DI](https://github.com/maou-shonen/hono-simple-DI) - [Highlight.io](https://www.highlight.io/docs/getting-started/backend-sdk/js/hono) +- [Pino logger](https://github.com/maou-shonen/hono-pino) From d1049d18f4008df100c5a701e904d51e7d78301a Mon Sep 17 00:00:00 2001 From: Stuart Moncrieff Date: Fri, 20 Dec 2024 14:39:08 +1100 Subject: [PATCH 2/2] docs(middleware/logger): how to disable status code coloring --- docs/middleware/builtin/logger.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/middleware/builtin/logger.md b/docs/middleware/builtin/logger.md index 0b3780a..7732a80 100644 --- a/docs/middleware/builtin/logger.md +++ b/docs/middleware/builtin/logger.md @@ -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 . Note that CloudFlare Workers do not have a `process.env` object, so will default to plaintext log output. +::: + ## PrintFunc The Logger Middleware accepts an optional `PrintFunc` function as a parameter. This function allows you to customize the logger and add additional logs.