logger

package module
v0.0.0-...-4d03714 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 7 Imported by: 1

README

logger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CorrelatedLog

type CorrelatedLog func(lvl LogLevel, correlationID, format string, a ...interface{})

CorrelatedLog provides logging with a level and correlation id for each message

func GetLogger

func GetLogger() CorrelatedLog

GetLogger returns access to the CorrelatedLog function for the initialised logging

func NewFileLogger

func NewFileLogger(fname string, lvl LogLevel, prefix string) (CorrelatedLog, error)

NewFileLogger creates a new log file at te specified location, which will contain entries up to the specified LogLevel

func NewLogger

func NewLogger(w io.Writer, lvl LogLevel, prefix string) CorrelatedLog

NewLogger writes entries to the specified io.Writer, if the level of the statement to be logged is less than the specified LogLevel

type LogLevel

type LogLevel int

LogLevel represents the level applied to the statement being logged

const (
	None LogLevel = iota
	Error
	Warn
	Info
	Debug
	All
)

func (LogLevel) String

func (l LogLevel) String() string

Jump to

Keyboard shortcuts

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