[PR #6411] [MERGED] fix(logger): log level priority #14893

Closed
opened 2026-04-13 09:41:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6411
Author: @danielfinke
Created: 11/29/2025
Status: Merged
Merged: 11/30/2025
Merged by: @Bekacru

Base: canaryHead: fix/logger-log-level-priority


📝 Commits (1)

  • a81fc8e fix(logger): log level priority

📊 Changes

2 files changed (+16 additions, -16 deletions)

View changed files

📝 packages/core/src/env/logger.test.ts (+13 -13)
📝 packages/core/src/env/logger.ts (+3 -3)

📄 Description

Ensure higher severity logs are published when the configured log level is lower (as it should be the "minimum" level to publish).

e.g., 'error' level messages should be published when BA is configured with log level 'info'

Unfortunately, this could be considered to be a breaking change. Although it may be what users were expecting all along and could be considered a bug just as much.

Fixes #6408


Summary by cubic

Updated logger level priority so the configured level is a minimum threshold; higher-severity messages are now published. Aligns logging behavior with common expectations and fixes #6408.

  • Bug Fixes

    • Reordered levels to: debug < info < success < warn < error.
    • Changed shouldPublishLog to publish when logLevel >= current level.
    • Updated tests to reflect the new priority.
  • Migration

    • If you want only errors: set level to "error". For warnings + errors: "warn". For info/success/warn/error: "info". For all logs: "debug".

Written for commit a81fc8e9b4. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6411 **Author:** [@danielfinke](https://github.com/danielfinke) **Created:** 11/29/2025 **Status:** ✅ Merged **Merged:** 11/30/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/logger-log-level-priority` --- ### 📝 Commits (1) - [`a81fc8e`](https://github.com/better-auth/better-auth/commit/a81fc8e9b45b45d7d1bd66c1d9271e05220b91ac) fix(logger): log level priority ### 📊 Changes **2 files changed** (+16 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/env/logger.test.ts` (+13 -13) 📝 `packages/core/src/env/logger.ts` (+3 -3) </details> ### 📄 Description Ensure higher severity logs are published when the configured log level is lower (as it should be the "minimum" level to publish). e.g., `'error'` level messages should be published when BA is configured with log level `'info'` Unfortunately, this could be considered to be a breaking change. Although it may be what users were expecting all along and could be considered a bug just as much. Fixes #6408 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Updated logger level priority so the configured level is a minimum threshold; higher-severity messages are now published. Aligns logging behavior with common expectations and fixes #6408. - **Bug Fixes** - Reordered levels to: debug < info < success < warn < error. - Changed shouldPublishLog to publish when logLevel >= current level. - Updated tests to reflect the new priority. - **Migration** - If you want only errors: set level to "error". For warnings + errors: "warn". For info/success/warn/error: "info". For all logs: "debug". <sup>Written for commit a81fc8e9b45b45d7d1bd66c1d9271e05220b91ac. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 09:41:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14893