loglevel

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 0 Imported by: 0

README

loglevel

a enum package of loglevel

levels

there are 7 levels.

const (
	All LogLevel = iota
	Debug
	Info
	Warn
	Error
	Fatal
	Off
)

All is contains all.
Debug is contains itself, Info, Warn, Error, Fatal.
...
Fatal is contains itself.
Off has nothing.

functions

WrapColor
func WrapColor(level LogLevel, message string) string

WrapColor is paint color to message.
if Fatal is violet.
if Error is red.
if Warn is yellow.
if Info is green.
if Debug is blue.

Avaliable
func Available(criterion, loglevel LogLevel) bool {
	return criterion <= loglevel
}

check loglevel is available or not.

Documentation

Index

Constants

View Source
const (
	All = iota
	Debug
	Info
	Warn
	Error
	Fatal
	Off
)

Variables

This section is empty.

Functions

func Available

func Available(criterion, loglevel int32) bool

func WrapColor

func WrapColor(level int32, message string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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