Documentation ¶
Index ¶
- Constants
- type Option
- type 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
- type TestingWriter
Constants ¶
View Source
const DefaultFormat = "[%{module}] %{shortfunc} -> %{level:.4s} %{id:04x} %{message}"
默认格式是一种日志编码格式,主要与默认格式兼容 日志格式,但不包括着色和时间。
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func NewTestLogger ¶
func (*Recorder) EntriesContaining ¶
func (*Recorder) EntriesMatching ¶
func (*Recorder) MessagesContaining ¶
func (*Recorder) MessagesMatching ¶
type RecordingCore ¶
type RecordingCore struct { zapcore.LevelEnabler // 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
type TestingWriter ¶
func (*TestingWriter) Sync ¶
func (t *TestingWriter) Sync() error
Click to show internal directories.
Click to hide internal directories.