Documentation ¶
Index ¶
- Constants
- 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(e Event, using Provider) error
- func GetLoggerOf(e Event, using Provider) *string
- func GetMessageOf(e Event, using Provider) *string
- func GetTimestampOf(e Event, 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 IsTraceEnabled() bool
- func IsWarnEnabled() bool
- 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
- func (instance *EventImpl) GetCallDepth() int
- func (instance *EventImpl) GetContext() interface{}
- func (instance *EventImpl) GetFields() fields.Fields
- func (instance *EventImpl) GetLevel() Level
- func (instance *EventImpl) With(key string, value interface{}) Event
- func (instance *EventImpl) WithCallDepth(add int) Event
- func (instance *EventImpl) WithFields(f fields.Fields) Event
- func (instance *EventImpl) Withf(key string, format string, args ...interface{}) Event
- func (instance *EventImpl) Without(keys ...string) Event
- type Level
- type LevelProvider
- type Levels
- type Logger
- func GetGlobalLogger() Logger
- func GetLogger(name string) Logger
- func NewLogger(cl CoreLogger) Logger
- func NewLoggerFacade(provider func() CoreLogger) Logger
- func Unwrap(in Logger) 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 LoggerCache
- type LoggerFactory
- type LoggingWriter
- type Provider
Constants ¶
View Source
const ( LevelTrace = Level(1000) LevelDebug = Level(2000) LevelInfo = Level(3000) LevelWarn = Level(4000) LevelError = Level(5000) LevelFatal = Level(6000) )
View Source
const (
GlobalLoggerName = "global"
)
Variables ¶
This section is empty.
Functions ¶
func GetErrorOf ¶
func GetLoggerOf ¶
func GetMessageOf ¶
func IsDebugEnabled ¶
func IsDebugEnabled() bool
func IsErrorEnabled ¶
func IsErrorEnabled() bool
func IsFatalEnabled ¶
func IsFatalEnabled() bool
func IsInfoEnabled ¶
func IsInfoEnabled() bool
func IsLevelEnabled ¶
func IsTraceEnabled ¶
func IsTraceEnabled() bool
func IsWarnEnabled ¶
func IsWarnEnabled() bool
func SetProvider ¶
func SetProvider(p Provider)
Types ¶
type CoreLogger ¶
type CoreLogger interface { GetName() string Log(Event) IsLevelEnabled(Level) bool GetProvider() Provider }
func UnwrapCore ¶ added in v0.3.0
func UnwrapCore(in CoreLogger) CoreLogger
type Event ¶
type Event interface { GetLevel() Level GetCallDepth() int GetContext() interface{} GetFields() fields.Fields With(key string, value interface{}) Event Withf(key string, format string, args ...interface{}) Event Without(keys ...string) Event WithFields(f fields.Fields) Event WithCallDepth(int) Event }
type EventImpl ¶
func (*EventImpl) GetCallDepth ¶
func (*EventImpl) GetContext ¶
func (instance *EventImpl) GetContext() interface{}
func (*EventImpl) WithCallDepth ¶ added in v0.5.0
func (*EventImpl) WithFields ¶ added in v0.4.0
type LevelProvider ¶
type LevelProvider func() []Level
var DefaultLevelProvider LevelProvider = func() []Level { return []Level{LevelTrace, LevelDebug, LevelInfo, LevelWarn, LevelError, LevelFatal} }
type Logger ¶
type Logger interface { CoreLogger 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 With(name string, value interface{}) Logger Withf(name string, format string, args ...interface{}) Logger WithError(error) Logger WithFields(fields.Fields) Logger }
func GetGlobalLogger ¶ added in v0.1.6
func GetGlobalLogger() Logger
func NewLogger ¶
func NewLogger(cl CoreLogger) Logger
func NewLoggerFacade ¶ added in v0.3.0
func NewLoggerFacade(provider func() CoreLogger) Logger
func WithFields ¶
type LoggerCache ¶ added in v0.4.0
func NewLoggerCache ¶ added in v0.4.0
func NewLoggerCache(factory LoggerFactory) LoggerCache
type LoggerFactory ¶ added in v0.4.0
type LoggingWriter ¶ added in v0.3.0
type LoggingWriter struct { CoreLogger LogAs Level }
type Provider ¶
type Provider interface { GetName() string GetLogger(name string) Logger GetAllLevels() []Level GetFieldKeySpec() fields.KeysSpec }
func AllProviders ¶
func AllProviders() []Provider
func GetProvider ¶
func GetProvider() Provider
func NewProviderFacade ¶ added in v0.3.0
func RegisterProvider ¶
func UnregisterProvider ¶
func UnwrapProvider ¶ added in v0.2.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.