autolog

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: BSD-2-Clause Imports: 13 Imported by: 3

README

go-autolog

Go library for initializing zerolog from the environment

Documentation

Index

Constants

View Source
const (
	LogLevelVarName      = "LOG_LEVEL"
	LogColorVarName      = "LOG_COLOR"
	LogOutputVarName     = "LOG_OUTPUT"
	LogFormatVarName     = "LOG_FORMAT"
	LogTimeFormatVarName = "LOG_TIMEFORMAT"
)

Variables

This section is empty.

Functions

func Done

func Done() error

func ExpandPath

func ExpandPath(str string, now time.Time) string

func ExpandTimeFormat

func ExpandTimeFormat(str string) string

func Init

func Init()

func Rotate

func Rotate() error

func Strftime

func Strftime(pattern string, t time.Time) string

func Writer

func Writer() io.Writer

Types

type RotatingLogWriter

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

func NewRotatingLogWriter

func NewRotatingLogWriter(pattern string, isPattern bool) (*RotatingLogWriter, error)

func (*RotatingLogWriter) Close

func (w *RotatingLogWriter) Close() error

func (*RotatingLogWriter) Rotate

func (w *RotatingLogWriter) Rotate() error

func (*RotatingLogWriter) WithFile

func (w *RotatingLogWriter) WithFile(fn func(name string, file *os.File) error) error

func (*RotatingLogWriter) Write

func (w *RotatingLogWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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