log

package
v0.28.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Log is the under log object

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)

SetLogFile to configure log params logWay: file or console

func SetLogLevel

func SetLogLevel(logLevel string)

SetLogLevel set log level, default is warning 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 is the log interface

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