logger

package
v0.0.0-...-67c52db Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

package logger defines as interface a writer may implement in order

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level uint8

Level defines log levels.

const (
	// LevelDebug defines debug log level.
	LevelDebug Level = iota
	// LevelInfo defines info log level.
	LevelInfo
	// LevelWarn defines warn log level.
	LevelWarn
	// LevelError defines error log level.
	LevelError
	// LevelFatal defines fatal log level.
	LevelFatal
	// LevelPanic defines panic log level.
	LevelPanic
)

func ParseLevel

func ParseLevel(lvl string) Level

ParseLevel takes a string level and returns the logger log level constant.

func (Level) String

func (lvl Level) String() string

Convert the Level to a string. E.g. LevelPanic becomes "panic".

type Logger

type Logger interface {
	Log(lvl Level, v ...interface{}) error
}

Logger defines as interface a writer may implement in order to receive level information with payload.

Jump to

Keyboard shortcuts

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