log

package
v0.0.0-...-1ec2636 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR      = 0
	ERROR_STR  = "error"
	WARN       = 1
	WARN_STR   = "warn"
	NOTICE     = 2
	NOTICE_STR = "notice"
	DEBUG      = 3
	DEBUG_STR  = "debug"
)

Variables

This section is empty.

Functions

func LevelToString

func LevelToString(level int) string

Types

type Log

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

func NewLog

func NewLog(level int, content string) (log Log)

type Logger

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

func New

func New(file string, bufferSize int, level int) (l *Logger, err error)

func New2

func New2(file string, bufferSize int, level string) (l *Logger, err error)

func (*Logger) Append

func (l *Logger) Append(log string, level ...int)

func (*Logger) AppendInfo

func (l *Logger) AppendInfo(args ...interface{})

func (*Logger) AppendObj

func (l *Logger) AppendObj(err error, args ...interface{})

func (*Logger) Close

func (l *Logger) Close() error

type MLogger

type MLogger []*Logger

func NewMLogger

func NewMLogger(prefix string, bufferSize int, level string) (l *MLogger, err error)

NewMLogger 创建新的日志对象,如果prefix==""则输出到标准输出

func (*MLogger) Append

func (l *MLogger) Append(log string, levels ...int)

func (*MLogger) AppendInfo

func (l *MLogger) AppendInfo(args ...interface{})

func (*MLogger) AppendObj

func (l *MLogger) AppendObj(err error, args ...interface{})

Jump to

Keyboard shortcuts

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