MCPcopy
hub / github.com/uber-go/zap / Core

Interface Core

zapcore/core.go:25–45  ·  zapcore/core.go::Core

Core is a minimal, fast logger interface. It's designed for library authors to wrap in a more user-friendly API.

Source from the content-addressed store, hash-verified

23// Core is a minimal, fast logger interface. It's designed for library authors
24// to wrap in a more user-friendly API.
25type Core interface {
26 LevelEnabler
27
28 // With adds structured context to the Core.
29 With([]Field) Core
30 // Check determines whether the supplied Entry should be logged (using the
31 // embedded LevelEnabler and possibly some extra logic). If the entry
32 // should be logged, the Core adds itself to the CheckedEntry and returns
33 // the result.
34 //
35 // Callers must use Check before calling Write.
36 Check(Entry, *CheckedEntry) *CheckedEntry
37 // Write serializes the Entry and any Fields supplied at the log site and
38 // writes them to their destination.
39 //
40 // If called, Write should always log the Entry and Fields; it should not
41 // replicate the logic of Check.
42 Write(Entry, []Field) error
43 // Sync flushes buffered logs (if any).
44 Sync() error
45}
46
47type nopCore struct{}
48

Callers 32

TestGlobalsConcurrentUseFunction · 0.65
Benchmark100FieldsFunction · 0.65
TestIncreaseLevelFunction · 0.65
FieldsFunction · 0.65
logMethod · 0.65
loglnMethod · 0.65
TestLoggerAtomicLevelFunction · 0.65
TestLoggerLogPanicFunction · 0.65

Implementers 8

partiallyNopCorezapio/writer_test.go
recordingCorezapcore/entry_test.go
countingCorezapcore/sampler_test.go
lazyWithCorezapcore/lazy_with.go
nopCorezapcore/core.go
ioCorezapcore/core.go
levelFilterCorezapcore/increase_level.go
contextObserverzaptest/observer/observer.go

Calls

no outgoing calls

Tested by

no test coverage detected