log

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 InitLog

func InitLog(logWay string, logFile string, logLevel string, maxdays int64)

func SetLogFile

func SetLogFile(logWay string, logFile string, maxdays int64)

logWay: file or console

func SetLogLevel

func SetLogLevel(logLevel string)

value: error, warning, info, debug, trace

func Trace

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

func Warn

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

Types

type Logger

type Logger interface {
	AddLogPrefix(string)
	GetPrefixStr() string
	GetAllPrefix() []string
	ClearLogPrefix()
	Error(string, ...interface{})
	Warn(string, ...interface{})
	Info(string, ...interface{})
	Debug(string, ...interface{})
	Trace(string, ...interface{})
}

Logger

type PrefixLogger

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

func NewPrefixLogger

func NewPrefixLogger(prefix string) *PrefixLogger

func (*PrefixLogger) AddLogPrefix

func (pl *PrefixLogger) AddLogPrefix(prefix string)

func (*PrefixLogger) ClearLogPrefix

func (pl *PrefixLogger) ClearLogPrefix()

func (*PrefixLogger) Debug

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

func (*PrefixLogger) Error

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

func (*PrefixLogger) GetAllPrefix

func (pl *PrefixLogger) GetAllPrefix() []string

func (*PrefixLogger) GetPrefixStr added in v0.13.0

func (pl *PrefixLogger) GetPrefixStr() string

func (*PrefixLogger) Info

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

func (*PrefixLogger) Trace

func (pl *PrefixLogger) Trace(format string, v ...interface{})

func (*PrefixLogger) Warn

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

Jump to

Keyboard shortcuts

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