logs

package
v0.0.0-...-29d1847 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugOn = 0x1
	InfoOn  = 0x3
	WarnOn  = 0x7
	ErrorOn = 0xF
	FatalOn = 0x1F
)
View Source
const (
	ErrorLevel = ErrorOn | FatalOn
	WarnLevel  = ErrorLevel | WarnOn
	InfoLevel  = WarnLevel | InfoOn
	DebugLevel = InfoLevel | DebugOn
)

Variables

This section is empty.

Functions

func Debug

func Debug(content ...interface{})

func Error

func Error(content ...interface{})

func Fatal

func Fatal(content ...interface{})

func Info

func Info(content ...interface{})

func SetDefaultLogger

func SetDefaultLogger(logger *Logger)

func Warn

func Warn(content ...interface{})

Types

type Logger

type Logger struct {
	Name string

	Writers []io.Writer

	Level uint8

	LogWithTime bool

	LastLogTime time.Time

	ColorfulConsoleOutput bool

	Lock sync.Mutex
}
var DefaultLogger *Logger

func NewLogger

func NewLogger(level uint8, w ...io.Writer) *Logger

func NewLoggerWithName

func NewLoggerWithName(name string, level uint8, w ...io.Writer) *Logger

func (*Logger) Debug

func (logger *Logger) Debug(content ...interface{})

func (*Logger) Error

func (logger *Logger) Error(content ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(content ...interface{})

func (*Logger) Info

func (logger *Logger) Info(content ...interface{})

func (*Logger) Log

func (logger *Logger) Log(prefix string, content ...interface{})

func (*Logger) LogColorful

func (logger *Logger) LogColorful(prefix, colorCode string, content ...interface{})

func (*Logger) LogTime

func (logger *Logger) LogTime()

func (*Logger) Warn

func (logger *Logger) Warn(content ...interface{})

Jump to

Keyboard shortcuts

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