level

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int8

Level level for logger

const (
	// Trace level. Designates finer-grained informational events than the Debug.
	Trace Level = iota - 2
	// Debug level. Usually only enabled when debugging. Very verbose logging.
	Debug
	// Info is the default logging priority.
	// General operational entries about what's going on inside the application.
	Info
	// Warn level. Non-critical entries that deserve eyes.
	Warn
	// Error level. Logs. Used for errors that should definitely be noted.
	Error
	// Fatal level. Logs and then calls `logger.Exit(1)`. highest level of severity.
	Fatal
)

func GetLevel

func GetLevel(levelStr string) (Level, error)

GetLevel converts a level string into a logger Level value. returns an error if the input string does not match known values.

func (Level) Enabled

func (l Level) Enabled(lvl Level) bool

Enabled returns true if the given level is at or above this level.

func (Level) String

func (i Level) String() string

func (Level) ToGorm

func (l Level) ToGorm() int

ToGorm trans to gorm log level

Jump to

Keyboard shortcuts

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