Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel = "debug" // InfoLevel is the default logging priority. InfoLevel = "info" // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel = "warn" // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel = "error" // DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. DPanicLevel = "dpanic" // PanicLevel logs a message, then panics. PanicLevel = "panic" // FatalLevel logs a message, then calls os.Exit(1). FatalLevel )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Option ¶
type Option func(*options)
func WithDevelopment ¶
func WithDevelopment() Option
WithDevelopment set the env is development, which will changes the behavior of DPanicLevel and takes stacktraces more liberally
func WithDisableCaller ¶
func WithDisableCaller() Option
WithDisableCaller Disable output of caller information in the log
func WithDisableStackTrace ¶
func WithDisableStackTrace() Option
WithDisableStackTrace disable the log to record a stack trace for all messages at or above panic level
Click to show internal directories.
Click to hide internal directories.