Documentation
¶
Overview ¶
Package json implements a json formatter which implements the Formatter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // FileSegs specifies how many segments from last of the File field of a // Record will be formatted. The separator of segment is '/'. // If FileSegs is not specified, 0 is used which means all. FileSegs int // PkgSegs specifies how many segments from last of the Pkg field of a // Record will be formatted. The separator of segment is '/'. // If PkgSegs is not specified, 0 is used which means all. PkgSegs int // FuncSegs specifies how many segments from last of the Func field of a // Record will be formatted. The separator of segment is '.'. // If FuncSegs is not specified, 0 is used which means all. FuncSegs int // Omit specifies which fields of a Record will be omitted. Omit OmitBits // OmitEmpty specifies which fields of a Record will be omitted when they are // the zero value of their type. OmitEmpty OmitBits // MinBufSize is the initial size of the internal buf of a formatter. // MinBufSize must NOT be negative. If it is not specified, 384 is used. MinBufSize int }
A Config is used to configure a json formatter.
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
A Formatter implements the interface iface.Formatter.
All methods of a Formatter are concurrency safe. A Formatter MUST be created with New.
func (*Formatter) UpdateConfig ¶
UpdateConfig calls the fn with the Config of the Formatter, and then sets the returned Config to the Formatter. The fn must NOT be nil.
Do NOT call any method of the Formatter or the Logger within the fn, or it may deadlock.
Click to show internal directories.
Click to hide internal directories.