logging

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireStdErr

func AcquireStdErr(transaction func(stdErr io.Writer) error) error

Types

type Config

type Config struct {
	LogLevel  *slog.LevelVar
	AddSource bool
}

func NewConfig

func NewConfig() Config

func (*Config) Flags

func (c *Config) Flags() *flag.FlagSet

func (*Config) Logger

func (c *Config) Logger() *slog.Logger

type LogFileNameFormatter

type LogFileNameFormatter interface {
	LogFileName(src OutputSource) string
}

type LogFileNameFormatterFunc

type LogFileNameFormatterFunc func(src OutputSource) string

func (LogFileNameFormatterFunc) LogFileName

func (f LogFileNameFormatterFunc) LogFileName(src OutputSource) string

type OutputSource

type OutputSource string
const (
	OutputSourceStdout OutputSource = "stdout"
	OutputSourceStderr OutputSource = "stderr"
)

type TaskOutputSink

type TaskOutputSink interface {
	StdOut() io.Writer
	StdErr() io.Writer
	Close() error
}

func NewTaskOutputSink

func NewTaskOutputSink(logsDirectory string, logToStdErr bool, formatter LogFileNameFormatter) (sink TaskOutputSink, err error)

Jump to

Keyboard shortcuts

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