logger

package
v0.0.0-...-1b8d80d Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package logger is a simple package to support rotating log file with multiple files and basic tagging

Index

Constants

This section is empty.

Variables

View Source
var (
	//FileTimeFmt specifies the date format for the log files
	FileTimeFmt = "06-01-02"
	//Default is the default logger
	Default *defaultLogger
)

Functions

func Log

func Log(kind, tag, msg string, err error)

Log in the 'kind' file a tagged message

func Logs

func Logs() ([]string, error)

Logs returns all the files in the log folder

func Read

func Read(kind string) (io.ReadCloser, error)

Read stream the required log file

func ReportHit

func ReportHit(label string)

func ReportValue

func ReportValue(label string, v float64)

func SetRoot

func SetRoot(p string) error

SetRoot set the folder where the log files will be stored

func Trace

func Trace(key string)

Types

type MultiLogger

type MultiLogger interface {
	SetRoot(p string) error
	Read(kind string) (io.ReadCloser, error)
	Logs() ([]string, error)
	Log(kind, tag, msg string, err error)
	ReportHit(lbl string)
	ReportValue(lbl string, v int)
	Trace(key string)
}

MultiLogger specifies an interface to log multiple sources than can be streamed

Jump to

Keyboard shortcuts

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