logger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateDaemonFilePath

func ValidateDaemonFilePath(path string) error

ValidateDaemonFilePath verifies that the daemon log file can be opened.

Types

type DaemonConfig

type DaemonConfig struct {
	FilePath         string
	Mode             Mode
	Stderr           io.Writer
	MaxFileSizeBytes int64
	MaxRetainedFiles int
	Level            slog.Leveler
}

DaemonConfig configures the daemon logger sink and mirroring policy.

type Mode

type Mode string

Mode controls daemon sink ownership for foreground and detached runs.

const (
	ModeForeground Mode = "foreground"
	ModeDetached   Mode = "detached"
)

type Runtime

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

Runtime owns one installed daemon logger instance.

func InstallDaemonLogger

func InstallDaemonLogger(cfg DaemonConfig) (*Runtime, error)

InstallDaemonLogger configures and installs the process-wide daemon logger.

func (*Runtime) Close

func (r *Runtime) Close() error

Close restores the previous default logger and closes the daemon sink.

func (*Runtime) Logger

func (r *Runtime) Logger() *slog.Logger

Logger returns the installed daemon logger.

Jump to

Keyboard shortcuts

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