filelog

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanLogger

type ChanLogger chan string

ChanLogger can replace a FileLogger in tests.

func (ChanLogger) Printf

func (c ChanLogger) Printf(format string, v ...interface{}) error

type FileLogger

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

Logs into a file. Timestamps are in UTC.

func NewFileLogger

func NewFileLogger(filepath string) (*FileLogger, error)

func (*FileLogger) Close

func (l *FileLogger) Close() error

func (*FileLogger) Printf

func (l *FileLogger) Printf(format string, v ...interface{}) error

log.Printf drops the returned error, we don't. In case of a write error, we reopen the file and try again.

Jump to

Keyboard shortcuts

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