Documentation
¶
Overview ¶
Package std provides a logger implementation via the Go built-in logger.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFmtFun = func(start time.Time, lvl log.LoggerLevel, msg string, fields []Field) string { timestr := color.CyanString(start.Format("02 15:04:05.000000")) lvlstr := "" switch lvl { case log.DebugLevel: lvlstr = fmt.Sprintf(" %s", color.New(color.Bold, color.FgYellow).Sprint("DBG")) case log.InfoLevel: lvlstr = fmt.Sprintf(" %s", color.New(color.Bold, color.FgGreen).Sprint("INF")) case log.ErrorLevel: lvlstr = fmt.Sprintf(" %s", color.New(color.Bold, color.FgRed).Sprint("ERR")) } fieldstr := "" for _, f := range fields { if fieldstr != "" { fieldstr += ", " } fieldstr += fmt.Sprintf("{%s: %v}", color.New(color.Bold).Sprint(f.Name), f.Value) } return fmt.Sprintf("%s%s %s %s", timestr, lvlstr, msg, fieldstr) }
Functions ¶
func NewFactory ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.