# Functions
AddSync converts an io.Writer to a WriteSyncer.
CapitalColorLevelEncoder serializes a Level to an all-caps string and adds color.
CapitalLevelEncoder serializes a Level to an all-caps string.
EpochMillisTimeEncoder serializes a time.Time to a floating-point number of milliseconds since the Unix epoch.
EpochNanosTimeEncoder serializes a time.Time to an integer number of nanoseconds since the Unix epoch.
EpochTimeEncoder serializes a time.Time to a floating-point number of seconds since the Unix epoch.
FullCallerEncoder serializes a caller in /full/path/to/package/file:line format.
FullNameEncoder serializes the logger name as-is.
ISO8601TimeEncoder serializes a time.Time to an ISO8601-formatted string with millisecond precision.
Lock wraps a WriteSyncer in a mutex to make it safe for concurrent use.
LowercaseColorLevelEncoder serializes a Level to a lowercase string and adds coloring.
LowercaseLevelEncoder serializes a Level to a lowercase string.
NanosDurationEncoder serializes a time.Duration to an integer number of nanoseconds elapsed.
NewConsoleEncoder creates an encoder whose output is designed for human - rather than machine - consumption.
NewCore creates a Core that writes logs to a WriteSyncer.
NewEntryCaller makes an EntryCaller from the return signature of runtime.Caller.
NewJSONEncoder creates a fast, low-allocation JSON encoder.
NewMapObjectEncoder creates a new map-backed ObjectEncoder.
NewMultiWriteSyncer creates a WriteSyncer that duplicates its writes and sync calls, much like io.MultiWriter.
NewNopCore returns a no-op Core.
NewSampler creates a Core that samples incoming entries, which caps the CPU and I/O load of logging while attempting to preserve a representative subset of your logs.
NewTee creates a Core that duplicates log entries into two or more underlying Cores.
RegisterHooks wraps a Core and runs a collection of user-defined callback hooks each time a message is logged.
SecondsDurationEncoder serializes a time.Duration to a floating-point number of seconds elapsed.
ShortCallerEncoder serializes a caller in package/file:line format, trimming all but the final directory from the full path.
StringDurationEncoder serializes a time.Duration using its built-in String method.
# Constants
ArrayMarshalerType indicates that the field carries an ArrayMarshaler.
BinaryType indicates that the field carries an opaque binary blob.
BoolType indicates that the field carries a bool.
ByteStringType indicates that the field carries UTF-8 encoded bytes.
Complex128Type indicates that the field carries a complex128.
Complex64Type indicates that the field carries a complex128.
DebugLevel logs are typically voluminous, and are usually disabled in production.
DefaultLineEnding defines the default line ending when writing logs.
DPanicLevel logs are particularly important errors.
DurationType indicates that the field carries a time.Duration.
ErrorLevel logs are high-priority.
ErrorType indicates that the field carries an error.
FatalLevel logs a message, then calls os.Exit(1).
Float32Type indicates that the field carries a float32.
Float64Type indicates that the field carries a float64.
InfoLevel is the default logging priority.
Int16Type indicates that the field carries an int16.
Int32Type indicates that the field carries an int32.
Int64Type indicates that the field carries an int64.
Int8Type indicates that the field carries an int8.
NamespaceType signals the beginning of an isolated namespace.
ObjectMarshalerType indicates that the field carries an ObjectMarshaler.
PanicLevel logs a message, then panics.
ReflectType indicates that the field carries an interface{}, which should be serialized using reflection.
SkipType indicates that the field is a no-op.
StringerType indicates that the field carries a fmt.Stringer.
StringType indicates that the field carries a string.
TimeType indicates that the field carries a time.Time.
Uint16Type indicates that the field carries a uint16.
Uint32Type indicates that the field carries a uint32.
Uint64Type indicates that the field carries a uint64.
Uint8Type indicates that the field carries a uint8.
UintptrType indicates that the field carries a uintptr.
UnknownType is the default field type.
WarnLevel logs are more important than Info, but don't need individual human review.
WriteThenFatal causes a fatal os.Exit after Write.
WriteThenNoop indicates that nothing special needs to be done.
WriteThenPanic causes a panic after Write.
# Structs
CheckedEntry is an Entry together with a collection of Cores that have already agreed to log it.
An EncoderConfig allows users to configure the concrete encoders supplied by zapcore.
An Entry represents a complete log message.
EntryCaller represents the caller of a logging function.
A Field is a marshaling operation used to add a key-value pair to a logger's context.
MapObjectEncoder is an ObjectEncoder backed by a simple map[string]interface{}.
# Interfaces
ArrayEncoder is a strongly-typed, encoding-agnostic interface for adding array-like objects to the logging context.
ArrayMarshaler allows user-defined types to efficiently add themselves to the logging context, and to selectively omit information which shouldn't be included in logs (e.g., passwords).
Core is a minimal, fast logger interface.
Encoder is a format-agnostic interface for all log entry marshalers.
LevelEnabler decides whether a given logging level is enabled when logging a message.
ObjectEncoder is a strongly-typed, encoding-agnostic interface for adding a map- or struct-like object to the logging context.
ObjectMarshaler allows user-defined types to efficiently add themselves to the logging context, and to selectively omit information which shouldn't be included in logs (e.g., passwords).
PrimitiveArrayEncoder is the subset of the ArrayEncoder interface that deals only in Go's built-in types.
A WriteSyncer is an io.Writer that can also flush any buffered data.
# Type aliases
ArrayMarshalerFunc is a type adapter that turns a function into an ArrayMarshaler.
A CallerEncoder serializes an EntryCaller to a primitive type.
CheckWriteAction indicates what action to take after a log entry is processed.
A DurationEncoder serializes a time.Duration to a primitive type.
A FieldType indicates which member of the Field union struct should be used and how it should be serialized.
A Level is a logging priority.
A LevelEncoder serializes a Level to a primitive type.
A NameEncoder serializes a period-separated logger name to a primitive type.
ObjectMarshalerFunc is a type adapter that turns a function into an ObjectMarshaler.
A TimeEncoder serializes a time.Time to a primitive type.