Documentation ¶
Index ¶
Constants ¶
View Source
const KnownCallerDepth = 5
KnownCallerDepth is the internally known call stack depth.
Variables ¶
View Source
var ( // DefaultExitFunc is the default exit function for all logger instances. DefaultExitFunc = os.Exit // EmptyExitFunc is the empty exit function for all logger instances. EmptyExitFunc = func(int) {} // DefaultPanicFunc is the default panic function for all logger instances. DefaultPanicFunc = func(s string) { panic(s) } // EmptyPanicFunc is the empty panic function for all logger instances. EmptyPanicFunc = func(string) {} // DefaultNowFunc is the default now function for all logger instances. DefaultNowFunc = time.Now // DefaultTimeFormat is the default time format for all logger instances. DefaultTimeFormat = time.RFC3339 // DefaultCallerReporter is the default caller for all logger instances. DefaultCallerReporter = new(CallerReporter) // ErrorWriter is used to output logger internal error messages. ErrorWriter io.Writer = os.Stderr )
Functions ¶
func EchoError ¶
func EchoError(format string, args ...interface{})
EchoError writes the given logger internal error message to ErrorWriter.
func StandardiseFieldsForJSONEncoder ¶
StandardiseFieldsForJSONEncoder standardizes the given log fields.
Types ¶
type CallerReporter ¶
type CallerReporter struct {
// contains filtered or unexported fields
}
CallerReporter defines the log caller reporter.
func NewCallerReporter ¶
func NewCallerReporter(skip int) *CallerReporter
NewCallerReporter returns a CallerReporter instance.
func (*CallerReporter) Equal ¶
func (o *CallerReporter) Equal(skip int) bool
Equal determines whether the given skip is equal to the current caller reporter.
func (*CallerReporter) GetCaller ¶
func (o *CallerReporter) GetCaller() string
GetCaller reports file and line number information about function invocations on the calling goroutine's stack.
type Fields ¶
type Fields map[string]interface{}
Fields type defines the dynamic field collection of the log. After Fields are created, their stored keys will not change.
Click to show internal directories.
Click to hide internal directories.