logger

package
v0.0.0-...-ac3ec41 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logger contains cofiguration for logger and multi level writer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path      string `yaml:"path" env:"LOG_PATH" envDefault:"/logs/"`
	ErrorFile string `yaml:"errorFile" env:"LOG_ERROR_FILE" envDefault:"error.log"`
	DebugFile string `yaml:"debugFile" env:"LOG_DEBUG_FILE" envDefault:"debug.log"`
}

Config contains arguments for initilizing logger.

type Configurator

type Configurator struct {
	// contains filtered or unexported fields
}

Configurator is a logger builder.

func NewConfigurator

func NewConfigurator(config *Config) (*Configurator, error)

NewConfigurator is a logger constructor.

func (*Configurator) Close

func (c *Configurator) Close()

Close the opened log files.

type LevelWriter

type LevelWriter struct {
	io.Writer
	Level zerolog.Level
}

LevelWriter is simple wraper for log write by level.

func (*LevelWriter) Close

func (lw *LevelWriter) Close() error

Close delegated writer.

func (*LevelWriter) WriteLevel

func (lw *LevelWriter) WriteLevel(l zerolog.Level, p []byte) (int, error)

WriteLevel filter write by log level.

Jump to

Keyboard shortcuts

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