DefaultFormat is a log encoding format that is mostly compatible with the default log format but excludes colorization and time.
const DefaultFormat = "[%{module}] %{shortfunc} -> %{level:.4s} %{id:04x} %{message}"
type Option func(r *RecordingCore, l *zap.Logger) *zap.Logger
func AtLevel(level zapcore.Level) Option
func Named(loggerName string) Option
type Recorder struct {
// contains filtered or unexported fields
}
func NewTestLogger(tb testing.TB, options ...Option) (*flogging.FabricLogger, *Recorder)
func (r *Recorder) Buffer() *gbytes.Buffer
func (r *Recorder) Entries() []string
func (r *Recorder) EntriesContaining(sub string) []string
func (r *Recorder) EntriesMatching(regex string) []string
func (r *Recorder) Messages() []string
func (r *Recorder) MessagesContaining(sub string) []string
func (r *Recorder) MessagesMatching(regex string) []string
func (r *Recorder) Reset()
type RecordingCore struct { zapcore.LevelEnabler // contains filtered or unexported fields }
func (r *RecordingCore) Check(e zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry
func (r *RecordingCore) Sync() error
func (r *RecordingCore) With(fields []zapcore.Field) zapcore.Core
func (r *RecordingCore) Write(e zapcore.Entry, fields []zapcore.Field) error
type TestingWriter struct{ testing.TB }
func (t *TestingWriter) Sync() error
func (t *TestingWriter) Write(buf []byte) (int, error)