logger

package
Version: v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2018 License: BSD-3-Clause Imports: 4 Imported by: 732

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Info

func Info(args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func RegisterLoggerFactory

func RegisterLoggerFactory(factory LoggerFactory)

func SetDefaultLogger

func SetDefaultLogger(name string)

func SetLogLevel

func SetLogLevel(level Level)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

Types

type DefaultLogger

type DefaultLogger struct {
	// contains filtered or unexported fields
}

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(args ...interface{})

Debug logs message at Debug level.

func (*DefaultLogger) DebugEnabled

func (l *DefaultLogger) DebugEnabled() bool

DebugEnabled checks if Debug level is enabled.

func (*DefaultLogger) Debugf

func (l *DefaultLogger) Debugf(format string, args ...interface{})

Debug logs message at Debug level.

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(args ...interface{})

Error logs message at Error level.

func (*DefaultLogger) ErrorEnabled

func (l *DefaultLogger) ErrorEnabled() bool

ErrorEnabled checks if Error level is enabled.

func (*DefaultLogger) Errorf

func (l *DefaultLogger) Errorf(format string, args ...interface{})

Error logs message at Error level.

func (*DefaultLogger) GetLogLevel

func (l *DefaultLogger) GetLogLevel() Level

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(args ...interface{})

Info logs message at Info level.

func (*DefaultLogger) InfoEnabled

func (l *DefaultLogger) InfoEnabled() bool

InfoEnabled checks if Info level is enabled.

func (*DefaultLogger) Infof

func (l *DefaultLogger) Infof(format string, args ...interface{})

Info logs message at Info level.

func (*DefaultLogger) SetLogLevel

func (l *DefaultLogger) SetLogLevel(logLevel Level)

SetLog Level

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(args ...interface{})

Warn logs message at Warning level.

func (*DefaultLogger) WarnEnabled

func (l *DefaultLogger) WarnEnabled() bool

WarnEnabled checks if Warning level is enabled.

func (*DefaultLogger) Warnf

func (l *DefaultLogger) Warnf(format string, args ...interface{})

Warn logs message at Warning level.

type DefaultLoggerFactory

type DefaultLoggerFactory struct {
}

func (*DefaultLoggerFactory) GetLogger

func (logfactory *DefaultLoggerFactory) GetLogger(name string) Logger

type Level

type Level int
const (
	DebugLevel Level = iota
	InfoLevel
	WarnLevel
	ErrorLevel
)

func GetLevelForName

func GetLevelForName(name string) (Level, error)

func GetLogLevel

func GetLogLevel() Level

type LogFormatter

type LogFormatter struct {
	// contains filtered or unexported fields
}

func (*LogFormatter) Format

func (f *LogFormatter) Format(entry *logrus.Entry) ([]byte, error)

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	SetLogLevel(Level)
	GetLogLevel() Level
}

func GetDefaultLogger

func GetDefaultLogger() Logger

func GetLogger

func GetLogger(name string) Logger

GetLogger returns the Logger using the logFactory registered. Returns nil if no factory is found

type LoggerFactory

type LoggerFactory interface {
	GetLogger(name string) Logger
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL