floggingtest

package
v0.0.0-...-25f8342 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
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.

Variables

This section is empty.

Functions

This section is empty.

Types

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 {
	zapcore.LevelEnabler
	// contains filtered or unexported fields
}

func (*RecordingCore) Check

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL