fabric: github.com/hyperledger/fabric/common/flogging/floggingtest Index | Files

package floggingtest

import "github.com/hyperledger/fabric/common/flogging/floggingtest"


Package Files



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 Uses

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

func AtLevel Uses

func AtLevel(level zapcore.Level) Option

func Named Uses

func Named(loggerName string) Option

type Recorder Uses

type Recorder struct {
    // contains filtered or unexported fields

func NewTestLogger Uses

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

func (*Recorder) Buffer Uses

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

func (*Recorder) Entries Uses

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

func (*Recorder) EntriesContaining Uses

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

func (*Recorder) EntriesMatching Uses

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

func (*Recorder) Messages Uses

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

func (*Recorder) MessagesContaining Uses

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

func (*Recorder) MessagesMatching Uses

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

func (*Recorder) Reset Uses

func (r *Recorder) Reset()

type RecordingCore Uses

type RecordingCore struct {
    // contains filtered or unexported fields

func (*RecordingCore) Check Uses

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

func (*RecordingCore) Sync Uses

func (r *RecordingCore) Sync() error

func (*RecordingCore) With Uses

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

func (*RecordingCore) Write Uses

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

type TestingWriter Uses

type TestingWriter struct{ testing.TB }

func (*TestingWriter) Sync Uses

func (t *TestingWriter) Sync() error

func (*TestingWriter) Write Uses

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

Package floggingtest imports 11 packages (graph). Updated 2019-11-14. Refresh now. Tools for package owners.