Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel = iota + 1 // 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 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface { // SetLevel set logger level SetLevel(lv Level) // WithContext with context WithContext(ctx context.Context) Logger // WithFields set fields to always be logged WithFields(fields map[string]interface{}) Logger // WithCallDepth with logger call depth. WithCallDepth(callDepth int) Logger // WithError with logger error WithError(err error) Logger // Debug uses fmt.Sprint to construct and log a message. Debug(args ...interface{}) // Info uses fmt.Sprint to construct and log a message. Info(args ...interface{}) // Warn uses fmt.Sprint to construct and log a message. Warn(args ...interface{}) // Error uses fmt.Sprint to construct and log a message. Error(args ...interface{}) // Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit. Fatal(args ...interface{}) // Debugf uses fmt.Sprintf to log a templated message. Debugf(template string, args ...interface{}) // Infof uses fmt.Sprintf to log a templated message. Infof(template string, args ...interface{}) // Warnf uses fmt.Sprintf to log a templated message. Warnf(template string, args ...interface{}) // Errorf uses fmt.Sprintf to log a templated message. Errorf(template string, args ...interface{}) // Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit. Fatalf(template string, args ...interface{}) StdLog() *log.Logger // Sync logger sync Sync() error }
Click to show internal directories.
Click to hide internal directories.