Skip to content

Replace logrus with gobuffalo/logger#2426

Merged
paganotoni merged 2 commits intomainfrom
std-logger
Mar 21, 2026
Merged

Replace logrus with gobuffalo/logger#2426
paganotoni merged 2 commits intomainfrom
std-logger

Conversation

@paganotoni
Copy link
Member

@paganotoni paganotoni commented Mar 21, 2026

This PR replaces direct usage of "github.com/sirupsen/logrus" with "github.com/gobuffalo/logger/v2" to align with the Buffalo ecosystem standard logging interface.

Changes

  • worker/simple.go: Use logger.New() from logger/v2
  • render/template.go: Use package-level log variable with logger/v2
  • plugins/plugins.go: Use package-level plog variable with logger/v2, added package documentation
  • errors_test.go: Remove direct logrus dependency, simplify logger test
  • logger.go: Updated to use logger/v2
  • options.go: Updated to use logger/v2
  • go.mod: Updated to github.com/gobuffalo/logger/v2 v2.0.0

What's New in logger v2.0.0

  • Uses slog (Go standard library log/slog) as the default logger implementation
  • logrus backend moved to a subpackage for users who prefer it
  • Lighter dependency tree (no direct logrus dependency in default case)

Benefits

  • Consistent logging interface across Buffalo codebase
  • Uses Go standard library slog as the default backend
  • Reduces external dependencies
  • Uses the standard Buffalo logger abstraction

@paganotoni paganotoni requested a review from a team as a code owner March 21, 2026 00:22
Replaces direct usage of github.com/sirupsen/logrus with github.com/gobuffalo/logger/v2
to align with the Buffalo ecosystem standard logging interface.

Key changes in logger v2.0.0:
- Uses slog (stdlib) as default logger instead of logrus
- logrus backend moved to subpackage for users who prefer it

Changes:
- worker/simple.go: Use logger.New() with logger/v2
- render/template.go: Use package-level log variable with logger/v2
- plugins/plugins.go: Use package-level plog variable with logger/v2, added package documentation
- errors_test.go: Remove direct logrus dependency, simplify logger test
- go.mod: Update to github.com/gobuffalo/logger/v2 v2.0.0
- Update logger dependency from v2.0.0 to v2.0.1
- Set default logger in  using
- Refactor packages to use shared default logger instead of creating new instances:
  -  now uses
  -  package-level var now uses
  -  package-level var now uses
  -  test helper now uses
@paganotoni paganotoni merged commit 514c1e2 into main Mar 21, 2026
8 checks passed
@paganotoni paganotoni deleted the std-logger branch March 21, 2026 14:10
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.

1 participant