log

package
v0.0.0-...-3b800f5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Ldate flags
	Ldate = log.Ldate
	// Llongfile flags
	Llongfile = log.Llongfile
	// Lmicroseconds flags
	Lmicroseconds = log.Lmicroseconds
	// Lshortfile flags
	Lshortfile = log.Lshortfile
	// LstdFlags flags
	LstdFlags = log.LstdFlags
	// Ltime flags
	Ltime = log.Ltime
)
View Source
const (
	// LogNone log nothing
	LogNone = Level(0x0)
	// LogFatal log fatal
	LogFatal = LogNone | Level(fatalLevel)
	// LogError log error & fatal
	LogError = LogFatal | Level(errorLevel)
	// LogWarn log warn & error & fatal
	LogWarn = LogError | Level(warnLevel)
	// LogInfo log info & warn & error & fatal
	LogInfo = LogWarn | Level(infoLevel)
	// LogDebug log debug & info & warn & error & fatal
	LogDebug = LogInfo | Level(debugLevel)
	// LogAll log all
	LogAll = LogDebug
)

Variables

This section is empty.

Functions

func CrashLog

func CrashLog(file string)

CrashLog set crash log

func Debug

func Debug(v ...interface{})

Debug debug

func DebugEnabled

func DebugEnabled() bool

DebugEnabled debug enabled

func Debugf

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

Debugf debugf

func DefaultStdLogger

func DefaultStdLogger() *log.Logger

DefaultStdLogger get default std Logger

func Error

func Error(v ...interface{})

Error error

func ErrorEnabled

func ErrorEnabled() bool

ErrorEnabled error enabled

func Errorf

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

Errorf errorf

func Fatal

func Fatal(v ...interface{})

Fatal fatal

func FatalEnabled

func FatalEnabled() bool

FatalEnabled fatal enabled

func Fatalf

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

Fatalf fatalf

func GetLogFile

func GetLogFile() string

GetLogFile get log file name

func Info

func Info(v ...interface{})

Info info

func InfoEnabled

func InfoEnabled() bool

InfoEnabled info enabled

func Infof

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

Infof infof

func InitLog

func InitLog()

InitLog init log

func SetFlags

func SetFlags(flags int)

SetFlags set log flags

func SetHighlighting

func SetHighlighting(highlighting bool)

SetHighlighting set highlighting log

func SetLevel

func SetLevel(level Level)

SetLevel set current log level

func SetLevelByString

func SetLevelByString(level string)

SetLevelByString set log by string level

func SetOutput

func SetOutput(out io.Writer)

SetOutput set log file use a writer

func SetOutputByName

func SetOutputByName(path string) error

SetOutputByName set log file use file name

func SetRotateByDay

func SetRotateByDay()

SetRotateByDay set default log rotate by day

func SetRotateByHour

func SetRotateByHour()

SetRotateByHour set default log rotate by hour

func Warn

func Warn(v ...interface{})

Warn warn

func WarnEnabled

func WarnEnabled() bool

WarnEnabled warn enabled

func Warnf

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

Warnf warnf

func Warning

func Warning(v ...interface{})

Warning warning

func Warningf

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

Warningf warningf

Types

type Cfg

type Cfg struct {
	LogLevel string
	LogFile  string
}

Cfg is the log cfg

type Level

type Level int

Level log level

func GetLogLevel

func GetLogLevel() Level

GetLogLevel get current log level

type Logger

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

Logger is a logger

func DefaultLogger

func DefaultLogger() *Logger

DefaultLogger get default Logger

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

func (*Logger) DebugEnabled

func (l *Logger) DebugEnabled() bool

DebugEnabled debug enabled

func (*Logger) Debugf

func (l *Logger) Debugf(format string, v ...interface{})

func (*Logger) Error

func (l *Logger) Error(v ...interface{})

func (*Logger) ErrorEnabled

func (l *Logger) ErrorEnabled() bool

ErrorEnabled error enabled

func (*Logger) Errorf

func (l *Logger) Errorf(format string, v ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(v ...interface{})

func (*Logger) FatalEnabled

func (l *Logger) FatalEnabled() bool

FatalEnabled fatal enabled

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, v ...interface{})

func (*Logger) GetFileName

func (l *Logger) GetFileName() string

func (*Logger) Info

func (l *Logger) Info(v ...interface{})

func (*Logger) InfoEnabled

func (l *Logger) InfoEnabled() bool

InfoEnabled info enabled

func (*Logger) Infof

func (l *Logger) Infof(format string, v ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(v ...interface{})

func (*Logger) Panicf

func (l *Logger) Panicf(format string, v ...interface{})

func (*Logger) SetHighlighting

func (l *Logger) SetHighlighting(highlighting bool)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

func (*Logger) SetLevelByString

func (l *Logger) SetLevelByString(level string)

func (*Logger) SetOutput

func (l *Logger) SetOutput(out io.Writer)

func (*Logger) SetOutputByName

func (l *Logger) SetOutputByName(path string) (err error)

func (*Logger) SetRotateByDay

func (l *Logger) SetRotateByDay()

func (*Logger) SetRotateByHour

func (l *Logger) SetRotateByHour()

func (*Logger) WarnEnabled

func (l *Logger) WarnEnabled() bool

WarnEnabled warn enabled

func (*Logger) Warning

func (l *Logger) Warning(v ...interface{})

func (*Logger) Warningf

func (l *Logger) Warningf(format string, v ...interface{})

type Type

type Type int

Type log type

Jump to

Keyboard shortcuts

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