Documentation ¶
Index ¶
- Constants
- Variables
- func AsStdLogger(in CoreLogger, logAs Level) *stdlog.Logger
- func ConfigureStd()
- func ConfigureStdWith(in CoreLogger, logAs Level)
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func GetErrorOf(fields fields.Fields, using Provider) error
- func GetLoggerOf(fields fields.Fields, using Provider) *string
- func GetMessageOf(fields fields.Fields, using Provider) *string
- func GetTimestampOf(fields fields.Fields, using Provider) *time.Time
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func IsDebugEnabled() bool
- func IsErrorEnabled() bool
- func IsFatalEnabled() bool
- func IsInfoEnabled() bool
- func IsLevelEnabled(level Level) bool
- func IsPanicEnabled() bool
- func IsTraceEnabled() bool
- func IsWarnEnabled() bool
- func Log(level Level, args ...interface{})
- func Logf(level Level, format string, args ...interface{})
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func SetProvider(p Provider)
- func Trace(args ...interface{})
- func Tracef(format string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- type CoreLogger
- type Event
- type EventImpl
- type Level
- type LevelAware
- type LevelNames
- type LevelProvider
- type Levels
- type Logger
- func AsLogger(in CoreLogger) Logger
- func GetGlobalLogger() Logger
- func GetLogger(name string) Logger
- func NewLogger(cl CoreLogger) Logger
- func With(name string, value interface{}) Logger
- func WithError(err error) Logger
- func WithFields(fields fields.Fields) Logger
- func Withf(name string, format string, args ...interface{}) Logger
- type Provider
- type ProviderFactory
- type SimpleProvider
- type StdLogger
- type Writer
Constants ¶
View Source
const ( LevelTrace = Level(1000) LevelDebug = Level(2000) LevelInfo = Level(3000) LevelWarn = Level(4000) LevelError = Level(5000) LevelFatal = Level(6000) LevelPanic = Level(7000) )
View Source
const (
GlobalLoggerName = "global"
)
Variables ¶
View Source
var (
ErrIllegalLevel = errors.New("illegal level")
)
Functions ¶
func AsStdLogger ¶
func AsStdLogger(in CoreLogger, logAs Level) *stdlog.Logger
func ConfigureStd ¶ added in v0.1.3
func ConfigureStd()
func ConfigureStdWith ¶ added in v0.1.3
func ConfigureStdWith(in CoreLogger, logAs Level)
func IsDebugEnabled ¶
func IsDebugEnabled() bool
func IsErrorEnabled ¶
func IsErrorEnabled() bool
func IsFatalEnabled ¶
func IsFatalEnabled() bool
func IsInfoEnabled ¶
func IsInfoEnabled() bool
func IsLevelEnabled ¶
func IsPanicEnabled ¶
func IsPanicEnabled() bool
func IsTraceEnabled ¶
func IsTraceEnabled() bool
func IsWarnEnabled ¶
func IsWarnEnabled() bool
func SetProvider ¶
func SetProvider(p Provider)
Types ¶
type CoreLogger ¶
type EventImpl ¶
func (*EventImpl) GetCallDepth ¶
func (*EventImpl) GetContext ¶
func (instance *EventImpl) GetContext() interface{}
type LevelAware ¶
type LevelNames ¶
var DefaultLevelNames LevelNames = &defaultLevelNames{}
type LevelProvider ¶
type LevelProvider func() []Level
var DefaultLevelProvider LevelProvider = func() []Level {
return defaultLevels
}
type Logger ¶
type Logger interface { CoreLogger Log(Level, ...interface{}) Logf(Level, string, ...interface{}) Trace(...interface{}) Tracef(string, ...interface{}) IsTraceEnabled() bool Debug(...interface{}) Debugf(string, ...interface{}) IsDebugEnabled() bool Info(...interface{}) Infof(string, ...interface{}) IsInfoEnabled() bool Warn(...interface{}) Warnf(string, ...interface{}) IsWarnEnabled() bool Error(...interface{}) Errorf(string, ...interface{}) IsErrorEnabled() bool Fatal(...interface{}) Fatalf(string, ...interface{}) IsFatalEnabled() bool Panic(...interface{}) Panicf(string, ...interface{}) IsPanicEnabled() bool With(name string, value interface{}) Logger Withf(name string, format string, args ...interface{}) Logger WithError(error) Logger WithFields(fields.Fields) Logger }
func AsLogger ¶
func AsLogger(in CoreLogger) Logger
func GetGlobalLogger ¶ added in v0.1.6
func GetGlobalLogger() Logger
func NewLogger ¶
func NewLogger(cl CoreLogger) Logger
func WithFields ¶
type Provider ¶
type Provider interface { GetName() string GetLogger(name string) Logger GetAllLevels() []Level GetFieldKeySpec() fields.KeysSpec GetLevelNames() LevelNames }
func AllProviders ¶
func AllProviders() []Provider
func GetProvider ¶
func GetProvider() Provider
func NewProvider ¶
func NewProvider(name string, factory ProviderFactory, levels LevelProvider) Provider
func RegisterProvider ¶
func UnregisterProvider ¶
type ProviderFactory ¶
type SimpleProvider ¶
func NewSimpleProvider ¶
func NewSimpleProvider(name string) *SimpleProvider
func (*SimpleProvider) GetLevel ¶
func (instance *SimpleProvider) GetLevel() Level
func (*SimpleProvider) SetLevel ¶
func (instance *SimpleProvider) SetLevel(level Level)
type StdLogger ¶
type StdLogger interface { CoreLogger Print(...interface{}) Printf(string, ...interface{}) Println(...interface{}) Fatal(...interface{}) Fatalf(string, ...interface{}) Fatalln(...interface{}) Panic(...interface{}) Panicf(string, ...interface{}) Panicln(...interface{}) }
func AsStdInterfacingLogger ¶ added in v0.1.3
func AsStdInterfacingLogger(in CoreLogger) StdLogger
Source Files ¶
Click to show internal directories.
Click to hide internal directories.