MCPcopy Index your code
hub / github.com/riverqueue/river / Logger

Function Logger

rivershared/riversharedtest/riversharedtest.go:197–205  ·  view source on GitHub ↗

Logger returns a logger suitable for use in tests. Defaults to informational verbosity. If env is set with `RIVER_DEBUG=true`, debug level verbosity is activated.

(tb testing.TB)

Source from the content-addressed store, hash-verified

195// Defaults to informational verbosity. If env is set with `RIVER_DEBUG=true`,
196// debug level verbosity is activated.
197func Logger(tb testing.TB) *slog.Logger {
198 tb.Helper()
199
200 if os.Getenv("RIVER_DEBUG") == "1" || os.Getenv("RIVER_DEBUG") == "true" {
201 return slogtest.NewLogger(tb, &slog.HandlerOptions{Level: slog.LevelDebug})
202 }
203
204 return slogtest.NewLogger(tb, nil)
205}
206
207// LoggerWarn returns a logger suitable for use in tests which outputs only at
208// warn or above. Useful in tests where particularly noisy log output is

Callers 15

TestJobCompleteTxFunction · 0.92
newTestConfigFunction · 0.92
Test_Client_InsertFunction · 0.92
Test_Client_InsertTxFunction · 0.92
Test_Client_InsertManyFunction · 0.92
Test_Client_InsertManyTxFunction · 0.92
TestResumableSetStepTxFunction · 0.92
TestStressFunction · 0.92
TestStressErrFunction · 0.92

Calls 2

NewLoggerFunction · 0.92
HelperMethod · 0.65

Tested by 15

TestJobCompleteTxFunction · 0.74
newTestConfigFunction · 0.74
Test_Client_InsertFunction · 0.74
Test_Client_InsertTxFunction · 0.74
Test_Client_InsertManyFunction · 0.74
Test_Client_InsertManyTxFunction · 0.74
TestResumableSetStepTxFunction · 0.74
TestStressFunction · 0.74
TestStressErrFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…