log

package module
v0.0.0-...-c5f2fd3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	InfoColor    = "\033[1;34m" // blue
	WarningColor = "\033[1;33m" // yellow
	ErrorColor   = "\033[1;31m" // red
	DebugColor   = "\033[0;36m" // ??
	ResetColor   = "\033[0m"
)

Variables

View Source
var ErrLevelNotValid = errors.New("that log level is not valid")
View Source
var ErrLevelStrNotValid = errors.New("that string is not a valid log level")

Functions

func AddColorPrefixes

func AddColorPrefixes()

func Debug

func Debug(s ...interface{})

func DefaultPrefixes

func DefaultPrefixes()

func Error

func Error(s ...interface{})

func Fatal

func Fatal(s ...interface{})

func Info

func Info(s ...interface{})

func PrintWithLevel

func PrintWithLevel(lvl Level, msg string) error

func SetFlags

func SetFlags(f int)

func SetLevel

func SetLevel(l Level)

func SetLevelFromFlag

func SetLevelFromFlag() error

func SetLevelStr

func SetLevelStr(l string) error

func Trace

func Trace(s ...interface{})

func Warn

func Warn(s ...interface{})

Types

type Level

type Level int8
const (
	NONE Level = iota
	ERROR
	WARN
	INFO
	DEBUG
	TRACE
	ALL
)

func LevelFromString

func LevelFromString(l string) (Level, error)

LevelFromString returns the level corresponding to the input string not case sensitive

Jump to

Keyboard shortcuts

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