logger

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LowPriorityLogFileName  = "info.log"
	HighPriorityLogFileName = "error.log"

	DefaultLogPathPerm = 0o766

	DefaultLogTick          = time.Second
	DefaultLogLogFirst      = 10
	DefaultLogLogThereafter = 5
)

Variables

This section is empty.

Functions

func L added in v0.1.1

func L() *zap.Logger

func MustMkDir

func MustMkDir(path string, dirperm os.FileMode)

func S

func S() *zap.SugaredLogger

func SetLogger

func SetLogger(m Mode, prodOpts ...ProdLoggerOpts)

SetLogger makes zap-based logger Use filepath.Join to make logpath

Types

type LogSamplerOpts

type LogSamplerOpts struct {
	Tick       time.Duration
	First      int // samples by logging the first N entries with a given level and message each tick
	Thereafter int // If more Entries with the same level and message are seen during the same interval, every Mth message is logged and the rest are dropped.
}

type Mode

type Mode int
const (
	DEBUG Mode = iota
	PROD
)

type ProdLoggerOpts added in v0.1.1

type ProdLoggerOpts struct {
	Sample   *LogSamplerOpts
	Logpath  string
	Pathperm os.FileMode
}

Jump to

Keyboard shortcuts

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