Content-Length: 290083 | pFad | http://github.com/github/github-mcp-server/pull/781

80 fix: replace logrus with slog by ricochet · Pull Request #781 · github/github-mcp-server · GitHub
Skip to content

fix: replace logrus with slog #781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ricochet
Copy link

The golang's blog article introducing slog calls out logrus directly as tooling it aims to replace with a solution in the standard language library.

This change replaces logrus with slog and adjusts some of the log outputs to use structured logs.

Closes: #780

@Copilot Copilot AI review requested due to automatic review settings July 29, 2025 00:06
@ricochet ricochet requested a review from a team as a code owner July 29, 2025 00:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the logging implementation from the third-party logrus library to Go's standard library slog, which was introduced to provide structured logging capabilities natively. The change modernizes the logging approach by using structured logging patterns and removes an external dependency.

  • Replaces logrus imports with slog throughout the codebase
  • Updates logging calls to use structured logging format with key-value pairs
  • Modifies logger initialization to use slog handlers instead of logrus formatters

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
go.mod Removes logrus dependency from module requirements
pkg/log/io.go Updates IOLogger to use slog.Logger and converts log calls to structured format
pkg/log/io_test.go Migrates test setup from logrus to slog with custom time attribute removal
internal/ghmcp/server.go Replaces logrus with slog for server logging and adds structured log messages
Comments suppressed due to low confidence (1)

pkg/log/io_test.go:60

  • [nitpick] The function name RemoveTimeAttr should follow Go naming conventions and be more descriptive. Consider renaming to removeTimeAttribute or filterTimeAttribute to better indicate its purpose as a filter function.
func RemoveTimeAttr(groups []string, a slog.Attr) slog.Attr {

ricochet added 2 commits July 28, 2025 20:10
Signed-off-by: Bailey Hayes <behayes2@gmail.com>
Signed-off-by: Bailey Hayes <behayes2@gmail.com>
@ricochet ricochet force-pushed the fix/logrus-to-slog branch from 25c669f to 8dab75f Compare July 29, 2025 00:13
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.

Use slog for logging instead of logrus
1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/github/github-mcp-server/pull/781

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy