mlog

package
v0.0.0-...-30b2c5b Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2016 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DebugPrefix allows you to change its styling
	DebugPrefix = "[\033[32mDEBUG\033[0m]"

	// InfoPrefix allows you to change its styling
	InfoPrefix = "[\033[34m~INFO\033[0m]"

	// WarnPrefix allows you to change its styling
	WarnPrefix = "[\033[33m!WARN\033[0m]"

	// ErrorPrefix allows you to change its styling
	ErrorPrefix = "[\033[31mERROR\033[0m]"

	// FatalPrefix allows you to change its styling
	FatalPrefix = "[\033[31mFATAL\033[0m]"

	// PanicPrefix allows you to change its styling
	PanicPrefix = "[\033[31mPANIC\033[0m]"
)

Functions

This section is empty.

Types

type Level

type Level uint8
const (
	// PanicLevel 0
	PanicLevel Level = iota

	// FatalLevel 1
	FatalLevel

	// ErrorLevel 2
	ErrorLevel

	// WarnLevel 3
	WarnLevel

	// InfoLevel 4
	InfoLevel

	// DebugLevel 5
	DebugLevel
)

type Logger

type Logger struct {
	Level      Level
	Out        io.Writer
	Prefix     string
	Time       bool
	TimeFormat string
}

Logger holds logging configurations

func New

func New() *Logger

NewLogger will initialize a new Logger struct

func (*Logger) Debug

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

Debug output

func (*Logger) Debugf

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

Debugf output

func (*Logger) Error

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

Error output

func (*Logger) Errorf

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

Errorf output

func (*Logger) Fatal

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

Fatal output

func (*Logger) Fatalf

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

Fatalf output

func (*Logger) Info

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

Info output

func (*Logger) Infof

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

Infof output

func (*Logger) Panic

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

Panic output

func (*Logger) Panicf

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

Panicf output

func (*Logger) SetLevel

func (log *Logger) SetLevel(l Level)

SetLevel allows you to have the current log level

func (*Logger) Warn

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

Warn output

func (*Logger) Warnf

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

Warnf output

Jump to

Keyboard shortcuts

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