Skip to content
Snippets Groups Projects

logtest: default to DPanicLevel for tests

Closed Administrator requested to merge k/20220511-log-dpanic into main

Created by: keegancsmith

Unit tests are often testing error conditions, which leads to log spam due to error logs. We can instead raise the log level to those which atleast cause panics which unlikely is part of the happy path in a test.

This follows the same pattern we see often in our tests for log15. In those we use the DiscardHandler unless verbose testing is enabled.

Test Plan: go test ./cmd/searcher/internal/search had no output.

Merge request reports

Approval is optional

Closed by avatar (Jul 6, 2025 10:19am UTC)

Merge details

  • The changes were not merged into main.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: bobheadxi

    Review: Commented

    I think some folks might still expect issues to show up in - there is logtest.InitWithLevel that allows package-level log level configuration, does that work in this scenario?

Please register or sign in to reply
Loading