loglevel

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 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

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available(criterion, loglevel LogLevel) bool

func WrapColor

func WrapColor(level LogLevel, message string) string

Types

type LogLevel

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

Jump to

Keyboard shortcuts

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