logging

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 3 Imported by: 5

Documentation

Overview

Package logging provides generic logging facilities.

Index

Constants

This section is empty.

Variables

View Source
var LevelNames = []string{"panic", "fatal", "error", "warn", "info", "debug", "trace"}

Functions

func SetDefaultLogger

func SetDefaultLogger(logger ILogger)

Types

type ILogger

type ILogger interface {
	Log(Level, string, m.Map)
	GetMaxLevel() Level
	SetMaxLevel(Level)
}

func GetDefaultLogger

func GetDefaultLogger() ILogger

type Level

type Level int
const (
	Panic Level = iota
	Fatal
	Error
	Warn
	Info
	Debug
	Trace
)

func NamedLevel

func NamedLevel(name string) Level

type Logger

type Logger struct {
	MaxLevel Level
}

func (*Logger) GetMaxLevel

func (logger *Logger) GetMaxLevel() Level

func (*Logger) Log

func (logger *Logger) Log(lvl Level, txt string, fields m.Map)

func (*Logger) SetMaxLevel

func (logger *Logger) SetMaxLevel(level Level)

Jump to

Keyboard shortcuts

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