logger

package
v0.0.0-...-b25a44a Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 2 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, v ...interface{})

func Error

func Error(format string, v ...interface{})

func Info

func Info(format string, v ...interface{})

func IsEnableDebug

func IsEnableDebug() bool

func IsEnableInfo

func IsEnableInfo() bool

func IsEnableWarn

func IsEnableWarn() bool

func SetLogger

func SetLogger(l Logger)

func Warn

func Warn(format string, v ...interface{})

Types

type DefaultLogger

type DefaultLogger struct {
	*log.Log
	// contains filtered or unexported fields
}

DefaultLogger is a default implementation of the Logger interface.

func NewDefaultLogger

func NewDefaultLogger(level int) *DefaultLogger

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(format string, v ...interface{})

func (*DefaultLogger) Error

func (l *DefaultLogger) Error(format string, v ...interface{})

func (*DefaultLogger) Info

func (l *DefaultLogger) Info(format string, v ...interface{})

func (*DefaultLogger) IsEnableDebug

func (l *DefaultLogger) IsEnableDebug() bool

func (*DefaultLogger) IsEnableInfo

func (l *DefaultLogger) IsEnableInfo() bool

func (*DefaultLogger) IsEnableWarn

func (l *DefaultLogger) IsEnableWarn() bool

func (*DefaultLogger) Warn

func (l *DefaultLogger) Warn(format string, v ...interface{})

type FileLogger

type FileLogger struct {
	*log.Log
	// contains filtered or unexported fields
}

func NewFileLogger

func NewFileLogger(logger *log.Log, level int) *FileLogger

func (*FileLogger) Debug

func (fl *FileLogger) Debug(format string, v ...interface{})

func (*FileLogger) Error

func (fl *FileLogger) Error(format string, v ...interface{})

func (*FileLogger) Info

func (fl *FileLogger) Info(format string, v ...interface{})

func (*FileLogger) IsEnableDebug

func (fl *FileLogger) IsEnableDebug() bool

func (*FileLogger) IsEnableInfo

func (fl *FileLogger) IsEnableInfo() bool

func (*FileLogger) IsEnableWarn

func (fl *FileLogger) IsEnableWarn() bool

func (*FileLogger) Warn

func (fl *FileLogger) Warn(format string, v ...interface{})

type Logger

type Logger interface {
	IsEnableDebug() bool
	IsEnableInfo() bool
	IsEnableWarn() bool

	Debug(format string, v ...interface{})
	Info(format string, v ...interface{})
	Warn(format string, v ...interface{})
	Error(format string, v ...interface{})
}

Logger encapsulation the log interface.

Jump to

Keyboard shortcuts

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