Replace logrus with slog for Wasm compatibility (COG-42)#88
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
Replace logrus with slog for Wasm compatibility (COG-42)#88devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes: COG-42
Replaces the
github.com/sirupsen/logrusdependency with Go's standard librarylog/slog. Logrus is in maintenance mode and does not compile forGOOS=wasip1 GOARCH=wasmtargets.slog(available since Go 1.21) is a drop-in replacement that enables Wasm compilation.Changes
internal/ghmcp/server.go: Replacelogrus.New()withslog.New(slog.NewTextHandler(...)). ThestdLoggerforSetErrorLoggernow writes directly to the sameio.Writerinstead of throughlogrusLogger.Writer().pkg/log/io.go: ChangeIOLoggerto accept*slog.Logger. Log calls switch fromInfofformat strings to structuredInfowith key-value pairs.pkg/log/io_test.go: Update test logger setup to useslog.NewTextHandler.go.mod/go.sum: Remove logrus dependency.third-party-licenses.*.md: Remove logrus license entry.Tradeoffs
"[stdin]: received 15 bytes: data"to structuredmsg="[stdin]: received bytes" count=15 data="data". This is idiomatic slog but is a visible format change in command logs.stdLogger(used bySetErrorLogger) previously wrote through logrus's formatting pipe; it now writes directly to the same output. The mcp-goSetErrorLoggerAPI only requires*log.Logger, which is unaffected.Human review checklist
stdLoggerchange inserver.go:218— it now useslogOutputdirectly instead oflogrusLogger.Writer(). This means error log lines won't pass through a structured formatter. Confirm this is acceptable.io.goRead/Write methods won't break any log consumers.Infoby default,DebugwhenLogFilePathis set.Link to Devin run: https://app.devin.ai/sessions/08a4736398424f3b90dc017d6a5ac9f4
Requested by: @ShawnAzman