logger

package
v0.0.0-...-385f941 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2018 License: Apache-2.0 Imports: 7 Imported by: 61

Documentation

Index

Constants

View Source
const DEFAULT_MAXLOGSIZE int64 = 20971520

Variables

This section is empty.

Functions

func CLOSE

func CLOSE()

func DEBUG

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

func Debug

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

func ERROR

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

func Error

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

func FATAL

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

func Fatal

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

func GetLevel

func GetLevel() string

func INFO

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

func Info

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

func OPEN

func OPEN(args *Args)

func PANIC

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

func Panic

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

func ParseLevel

func ParseLevel(level string)

func SetLevel

func SetLevel(level Level)

func SetOutput

func SetOutput(w io.Writer)

func WARN

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

func Warn

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

Types

type Args

type Args struct {
	FileName string
	Level    string
	MaxSize  int64
}

type Glogger

type Glogger struct {
	LogFile *os.File
	Rander  *rand.Rand
	*Args
}

type Level

type Level uint8
const (
	DebugLevel Level = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
	PanicLevel
)
const DefaultLevel Level = InfoLevel

type Logger

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

func New

func New(logger *log.Logger, level Level) *Logger

func (*Logger) Debug

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

func (*Logger) Error

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

func (*Logger) Fatal

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

func (*Logger) GetLevel

func (l *Logger) GetLevel() string

func (*Logger) Info

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

func (*Logger) Panic

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

func (*Logger) ParseLevel

func (l *Logger) ParseLevel(level string)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

func (*Logger) Warn

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

Jump to

Keyboard shortcuts

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