level

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 4 Imported by: 17

Documentation

Overview

Package level defines a Priority type and some conversion methods for a 7-tiered logging level schema, which mirror syslog and system's logging levels.

Levels range from Emergency (0) to Debug (7), and the special type Priority and associated constants provide access to these values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Priority

type Priority uint8

Priority is an integer that tracks log levels. Use with one of the defined constants.

const (
	Emergency Priority = 250
	Alert     Priority = 225
	Critical  Priority = 200
	Error     Priority = 175
	Warning   Priority = 150
	Notice    Priority = 125
	Info      Priority = 100
	Debug     Priority = 50
	Trace     Priority = 25
	Invalid   Priority = 0
)

Constants defined for easy access to

func FromString

func FromString(l string) Priority

FromString takes a string, (case insensitive, leading and trailing space removed, )

func (Priority) String

func (p Priority) String() string

String implements the Stringer interface and makes it possible to print human-readable string identifier for a log level.

Jump to

Keyboard shortcuts

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