Skip to content

Replace logrus with log/slog - #448

Merged
folbricht merged 1 commit into
masterfrom
slog
Oct 18, 2026
Merged

folbricht merged 1 commit into
masterfrom
slog

Conversation

@folbricht

Copy link
Copy Markdown
Owner

Replace github.com/sirupsen/logrus with the standard library's log/slog and drop logrus from the module dependencies.

  • desync.Log is a *slog.Logger backed by slog.DiscardHandler, so the library stays silent unless a caller installs a handler.
  • --verbose sets desync.Log to a slog.TextHandler on stderr at debug level.
  • Fields become slog attributes on the logging call. WithError(err) becomes an "error" attribute, and the per-request loggers in the GCS and HTTP stores use Log.With(...).

This changes the exported API: desync.Log was a *logrus.Logger, so library users that configure or call it need to switch to *slog.Logger. The --verbose output format also changes to slog's time=… level=DEBUG msg=… key=value.

desync.Log is now a *slog.Logger that discards output by default. --verbose installs a text handler on stderr at debug level. Call sites pass fields as slog attributes, with errors under the "error" key.
@folbricht
folbricht merged commit 7e50053 into master Oct 18, 2026
@folbricht
folbricht deleted the slog branch October 18, 2026 13:39
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