diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-21 13:10:16 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-21 14:27:36 +0300 |
commit | 2fd12987428f5f7b69d31253b86c1749e4a5935c (patch) | |
tree | 5c5ef5f131b576f7130ae88cee91ee7ef08f3565 | |
parent | 0281cdac3825b5ed52a9b094626edfdfa2ab58a5 (diff) |
log: Remove `Debugln()` and related functions from `Logger` interface
Drop `Debugln()` and related functions. The only difference to the
`Debug()` family of functions is that they use `fmt.Sprintln()` to
format the log message, which guarantees that the arguments will be
separated by a space. This difference is non-obvious and also not
supported by the `slog` package.
The only user of this function is the Yamux log wrapper, which we adapt
accordingly.
-rw-r--r-- | internal/grpc/backchannel/backchannel.go | 4 | ||||
-rw-r--r-- | internal/log/logger.go | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/internal/grpc/backchannel/backchannel.go b/internal/grpc/backchannel/backchannel.go index 121aa480a..bcbc09c0e 100644 --- a/internal/grpc/backchannel/backchannel.go +++ b/internal/grpc/backchannel/backchannel.go @@ -29,6 +29,7 @@ package backchannel import ( + "fmt" "net" "sync" @@ -49,7 +50,8 @@ func (l yamuxLogWrapper) Printf(format string, args ...any) { } func (l yamuxLogWrapper) Println(args ...any) { - l.logger.Infoln(args...) + msg := fmt.Sprintln(args...) + l.logger.Info(msg[:len(msg)-1]) } // magicBytes are sent by the client to server to identify as a multiplexing aware client. diff --git a/internal/log/logger.go b/internal/log/logger.go index 4c8cf2e13..9f07ec205 100644 --- a/internal/log/logger.go +++ b/internal/log/logger.go @@ -28,11 +28,6 @@ type Logger interface { Warn(args ...any) Error(args ...any) - Debugln(args ...any) - Infoln(args ...any) - Warnln(args ...any) - Errorln(args ...any) - StreamServerInterceptor(...grpcmwlogrus.Option) grpc.StreamServerInterceptor UnaryServerInterceptor(...grpcmwlogrus.Option) grpc.UnaryServerInterceptor } |