level

package
v0.0.0-...-7893cc3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level interface {
	// String returns the level as a string
	String() string
	// Int returns the level as an int
	Int() int
}

Level interface describes the behavior that a log level should have

It must provide methods to be casted as a string or as an int

var (
	// Trace represents log level 0
	Trace Level = lTrace
	// Debug represents log level 1
	Debug Level = lDebug
	// Info represents log level 2
	Info Level = lInfo
	// Warn represents log level 3
	Warn Level = lWarn
	// Error represents log level 4
	Error Level = lError
	// Fatal represents log level 5
	Fatal Level = lFatal
)

func AsLevel

func AsLevel(level string) Level

AsLevel converts an input string to a Level, returning nil if invalid

Jump to

Keyboard shortcuts

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