MCPcopy
hub / github.com/etcd-io/etcd / NewLogObserver

Function NewLogObserver

tests/framework/testutils/log_observer.go:38–47  ·  view source on GitHub ↗
(level zapcore.LevelEnabler)

Source from the content-addressed store, hash-verified

36}
37
38func NewLogObserver(level zapcore.LevelEnabler) (zapcore.Core, *LogObserver) {
39 // align with zaptest
40 enc := zapcore.NewConsoleEncoder(zap.NewDevelopmentEncoderConfig())
41
42 co, ob := zapobserver.New(level)
43 return co, &LogObserver{
44 ob: ob,
45 enc: enc,
46 }
47}
48
49// Expect returns the first N lines containing the given string.
50func (logOb *LogObserver) Expect(ctx context.Context, s string, count int) ([]string, error) {

Callers 2

TestLogObserver_TimeoutFunction · 0.85
TestLogObserver_ExpectFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestLogObserver_TimeoutFunction · 0.68
TestLogObserver_ExpectFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…