Back to

Package floggingtest

Latest Go to latest

The latest major version is .

Published: Jun 1, 2020 | License: Apache-2.0 | Module:



const DefaultFormat = "[%{module}] %{shortfunc} -> %{level:.4s} %{id:04x} %{message}"

DefaultFormat is a log encoding format that is mostly compatible with the default log format but excludes colorization and time.

type Option

type Option func(r *RecordingCore, l *zap.Logger) *zap.Logger

func AtLevel

func AtLevel(level zapcore.Level) Option

func Named

func Named(loggerName string) Option

type Recorder

type Recorder struct {
	// contains filtered or unexported fields

func NewTestLogger

func NewTestLogger(tb testing.TB, options ...Option) (*flogging.FabricLogger, *Recorder)

func (*Recorder) Buffer

func (r *Recorder) Buffer() *gbytes.Buffer

func (*Recorder) Entries

func (r *Recorder) Entries() []string

func (*Recorder) EntriesContaining

func (r *Recorder) EntriesContaining(sub string) []string

func (*Recorder) EntriesMatching

func (r *Recorder) EntriesMatching(regex string) []string

func (*Recorder) Messages

func (r *Recorder) Messages() []string

func (*Recorder) MessagesContaining

func (r *Recorder) MessagesContaining(sub string) []string

func (*Recorder) MessagesMatching

func (r *Recorder) MessagesMatching(regex string) []string

func (*Recorder) Reset

func (r *Recorder) Reset()

type RecordingCore

type RecordingCore struct {
	// contains filtered or unexported fields

func (*RecordingCore) Check

func (r *RecordingCore) Check(e zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry

func (*RecordingCore) Sync

func (r *RecordingCore) Sync() error

func (*RecordingCore) With

func (r *RecordingCore) With(fields []zapcore.Field) zapcore.Core

func (*RecordingCore) Write

func (r *RecordingCore) Write(e zapcore.Entry, fields []zapcore.Field) error

type TestingWriter

type TestingWriter struct{ testing.TB }

func (*TestingWriter) Sync

func (t *TestingWriter) Sync() error

func (*TestingWriter) Write

func (t *TestingWriter) Write(buf []byte) (int, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier