mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2026-08-03 15:49:23 +02:00
chore(deps): update all dependencies to latest (#212)
Bumps all direct dependencies to their latest versions. | Dependency | From | To | | ----------------------------- | ------- | ------------ | | `gitea.dev/sdk` | v1.0.1 | v1.2.0 | | `github.com/mark3labs/mcp-go` | v0.45.0 | v0.56.0 | | `go.uber.org/zap` | v1.27.1 | v1.28.0 | | `go.uber.org/zap/exp` | — | v0.3.0 (new) | ### Required code change mcp-go v0.56 moved transport logging to `log/slog` and renamed the streamable-HTTP logger option to `WithStreamableHTTPLogger(*slog.Logger)`. Added a `log.Slog()` bridge (via the official `zapslog` adapter) so the HTTP transport keeps logging through the existing zap pipeline, and switched `operation.go` to the new option. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/212 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -8,6 +9,7 @@ import (
|
||||
"gitea.com/gitea/gitea-mcp/pkg/flag"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/exp/zapslog"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"gopkg.in/natefinch/lumberjack.v2"
|
||||
)
|
||||
@@ -79,6 +81,13 @@ func SetDefault(logger *zap.Logger) {
|
||||
}
|
||||
}
|
||||
|
||||
// Slog returns a *slog.Logger that writes through the default zap logger,
|
||||
// so structured logging from dependencies (e.g. the MCP HTTP transport) shares
|
||||
// the same destination and formatting as the rest of the server.
|
||||
func Slog() *slog.Logger {
|
||||
return slog.New(zapslog.NewHandler(Default().Core()))
|
||||
}
|
||||
|
||||
func Debug(msg string, fields ...zap.Field) {
|
||||
Default().Debug(msg, fields...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user