You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// NewLogger returns a *slog.Logger associated with the test t.
funcNewLogger(t testing.TB) *slog.Logger {
// The slogt package has been stable and effective
// for adapting slog to testing.T.Log calls.
// Prefer to abstract slogt behind a gtest interface
// to reduce a direct dependency from tests to an external module.
returnslogt.New(t, slogt.Text())
}
Change that plain call to slogt.New to use slogt.Bridge. Continue to use the Text handler, but set the Bridge's Handle method to drop records that have level debug and that do not haveroot=gcosmos, so that we can still see gcosmos debug logs by default.
The text was updated successfully, but these errors were encountered:
There are many SDK logs with level=DEBUG that are usually not interesting to us in gcosmos tests:
The gcosmos tests call
gcosmos/internal/copy/gtest.NewTestLogger
to produce the test logger:gcosmos/internal/copy/gtest/log.go
Lines 10 to 17 in fde677d
Change that plain call to
slogt.New
to useslogt.Bridge
. Continue to use the Text handler, but set the Bridge'sHandle
method to drop records that have level debug and that do not haveroot=gcosmos
, so that we can still see gcosmos debug logs by default.The text was updated successfully, but these errors were encountered: