secureworks/logger

Bad docs for testlogger

Closed this issue · 3 comments

hews commented

Docs for testlogger suggest wrong type assertion to get back a testlogger type:

// logger, _ := l.(testlogger.Logger)

Should be:

logger, _ := l.(*testlogger.Logger)
hews commented

Should testlogger.New return a *testlogger.Logger?

hews commented

testlogger should implement UnderlyingLogger.

should have a testlogger.MustNew(...) (logger) function.

Should testlogger.New return a *testlogger.Logger?

That, and/or another function akin to NewTestLogger that returns the concrete type. Having New do it might be fine as well, as long as it's still available from log.Open