mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-07 06:03:05 -04:00
added a test writer
removed unnecessary writer
This commit is contained in:
parent
6cc282bc7c
commit
1d0c6aa7fc
1 changed files with 12 additions and 2 deletions
|
@ -41,11 +41,12 @@ package logger
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
"runtime"
|
"time"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
|
"github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
@ -231,3 +232,12 @@ func middlewareLogger(l *slog.Logger) logging.Logger {
|
||||||
_ = l.Handler().Handle(context.Background(), r)
|
_ = l.Handler().Handle(context.Background(), r)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TestWriter struct {
|
||||||
|
t *testing.T
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t TestWriter) Write(p []byte) (int, error) {
|
||||||
|
t.t.Log(p)
|
||||||
|
return len(p), nil
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue