Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Level ¶ added in v0.0.6
type Level int8
const ( // TraceLevel level. Designates finer-grained informational events than the Debug. TraceLevel Level = iota - 2 // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel // InfoLevel is the default logging priority. // General operational entries about what's going on inside the application. InfoLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. ErrorLevel // FatalLevel level. Logs and then calls `logger.Exit(1)`. highest level of severity. FatalLevel )
func GetLevel ¶ added in v0.0.6
GetLevel converts a level string into a logger Level value. returns an error if the input string does not match known values.
type Logger ¶ added in v0.0.3
type Option ¶ added in v0.0.6
type Option func(*Options)
func WithCallerSkipCount ¶ added in v0.0.6
WithCallerSkipCount set frame count to skip.
func WithContext ¶ added in v0.1.1
func WithContext(k, v interface{}) Option
WithContext set Context
func WithFields ¶ added in v0.0.6
WithFields set default fields for the logger.
func WithOutput ¶ added in v0.0.6
WithOutput set default output writer for the logger.
type Options ¶ added in v0.0.6
type Options struct { // It's common to set this to a file, or leave it default which is `os.Stderr` Out io.Writer // Alternative options Context context.Context // fields to always be logged Fields map[string]interface{} // Caller skip frame count for file:line info CallerSkipCount int // The logging level the logger should log at. default is `InfoLevel` Level Level }
Click to show internal directories.
Click to hide internal directories.