logger

package
v0.0.0-...-7dcfc68 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

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

type Logger

type Logger struct {
	LogLevel  LogLevel
	Output    io.Writer
	Formatter *TextFormatter
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger() *Logger

func (*Logger) Debug

func (log *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (log *Logger) Error(format string, args ...interface{})

func (*Logger) Fatal

func (log *Logger) Fatal(format string, args ...interface{})

func (*Logger) Info

func (log *Logger) Info(format string, args ...interface{})

func (*Logger) Panic

func (log *Logger) Panic(format string, args ...interface{})

func (*Logger) Print

func (log *Logger) Print(format string, args ...interface{})

func (*Logger) SetColored

func (log *Logger) SetColored(flag bool)

func (*Logger) Warn

func (log *Logger) Warn(format string, args ...interface{})

func (*Logger) Warning

func (log *Logger) Warning(format string, args ...interface{})

type TextFormatter

type TextFormatter struct {
	Colored bool
}

func (*TextFormatter) Format

func (f *TextFormatter) Format(level LogLevel, message string) ([]byte, error)

Jump to

Keyboard shortcuts

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