daemon

package
v0.260224.1130 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Daemonize

func Daemonize() error

Daemonize detaches the process from the terminal and runs in the background This works on Unix-like systems (Linux, macOS)

func IsDaemonProcess

func IsDaemonProcess() bool

IsDaemonProcess checks if the current process is running as a daemon

func NewLogger

func NewLogger(cfg *LogRotationConfig) *lumberjack.Logger

NewLogger creates a new lumberjack logger with the given configuration

Types

type LogRotationConfig

type LogRotationConfig struct {
	Filename   string // Log file path
	MaxSize    int    // Maximum size in megabytes
	MaxBackups int    // Maximum number of old log files to retain
	MaxAge     int    // Maximum number of days to retain old log files
	Compress   bool   // Compress old log files
}

LogRotationConfig holds configuration for log rotation

func DefaultLogRotationConfig

func DefaultLogRotationConfig(logFile string) *LogRotationConfig

DefaultLogRotationConfig returns default log rotation settings

Jump to

Keyboard shortcuts

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