Skip to content

feat(hono): adds option to set the log level for req/res logs - #63

Open
dgoerdes wants to merge 1 commit into
mainfrom
feature/hono-loglevel-option
Open

feat(hono): adds option to set the log level for req/res logs#63
dgoerdes wants to merge 1 commit into
mainfrom
feature/hono-loglevel-option

Conversation

@dgoerdes

@dgoerdes dgoerdes commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 LoggerOptions with logLevel?: LogLevel and route REQ/RES log lines through that level.
  • Add Deno tests validating behavior for logLevel: "debug" and logLevel: "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);
};
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