Documentation ¶
Overview ¶
Package log implements a featured and structured generic logger interface designed to be used in core and third-party vinxi components.
Index ¶
- Constants
- Variables
- func AddHook(hook log.Hook)
- func Debug(msg string)
- func Debugf(msg string, v ...interface{})
- func Error(msg string)
- func Errorf(msg string, v ...interface{})
- func Fatal(msg string)
- func Fatalf(msg string, v ...interface{})
- func GetLevel() log.Level
- func Info(msg string)
- func Infof(msg string, v ...interface{})
- func New() *log.Logger
- func SetFormatter(formatter log.Formatter)
- func SetLevel(level log.Level)
- func SetOutput(out io.Writer)
- func Trace(msg string) *log.Entry
- func Warn(msg string)
- func Warnf(msg string, v ...interface{})
- func WithError(err error) *log.Entry
- func WithField(key string, value interface{}) *log.Entry
- func WithFields(fields log.Fields) *log.Entry
- type Interface
Constants ¶
View Source
const Version = "0.1.0"
Version defines the current package semantic version.
Variables ¶
View Source
var Logger = log.New()
Logger represents the standard default built-in logger (equivalent to default Logrus logger).
Functions ¶
func Fatalf ¶
func Fatalf(msg string, v ...interface{})
Fatalf level formatted message, followed by an exit.
func SetFormatter ¶
SetFormatter sets the standard logger formatter.
func Trace ¶
Trace returns a new entry with a Stop method to fire off a corresponding completion log, useful with defer.
Types ¶
type Interface ¶
type Interface interface { WithFields(fields log.Fields) *log.Entry WithField(key string, value interface{}) *log.Entry WithError(err error) *log.Entry Debug(...interface{}) Info(...interface{}) Warn(...interface{}) Error(...interface{}) Fatal(...interface{}) Debugf(msg string, v ...interface{}) Infof(msg string, v ...interface{}) Warnf(msg string, v ...interface{}) Errorf(msg string, v ...interface{}) Fatalf(msg string, v ...interface{}) }
Interface represents the API of both Logger and Entry.
Click to show internal directories.
Click to hide internal directories.