feat(hono): adds option to set the log level for req/res logs - #63
Open
dgoerdes wants to merge 1 commit into
Open
feat(hono): adds option to set the log level for req/res logs#63dgoerdes wants to merge 1 commit into
dgoerdes wants to merge 1 commit into
Conversation
|
There was a problem hiding this comment.
Pull request overview
Adds a configurable logLevel option to the Hono logger middleware so request/response log lines can be emitted at a chosen severity (or skipped entirely with silent), aligning middleware logging behavior with Nimbus’ core logger levels.
Changes:
- Extend
LoggerOptionswithlogLevel?: LogLeveland route REQ/RES log lines through that level. - Add Deno tests validating behavior for
logLevel: "debug"andlogLevel: "silent". - Update package and docs examples to document the new option.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/hono/src/lib/middleware/logger.ts | Adds logLevel option and refactors request/response logging to use it. |
| packages/hono/src/lib/middleware/logger.test.ts | New tests covering configured log level output and silent behavior. |
| packages/hono/README.md | Documents logLevel usage in README example and explanation text. |
| packages/hono/deno.json | Adds @std/assert import used by the new test. |
| docs/guide/hono/logger.md | Updates configuration table and examples to include logLevel. |
| deno.lock | Locks the new @std/assert dependency for the Hono package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+76
to
+82
| const log = (logInput: LogInput): void => { | ||
| if (logLevel === 'silent') { | ||
| return; | ||
| } | ||
|
|
||
| getLogger()[logLevel](logInput); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.