logging

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Init

func Init(debug bool, isService bool)

Init initializes the logger. isService: when true, skips stderr (Windows Services have no console).

func LogFilePath added in v0.2.6

func LogFilePath() string

LogFilePath returns the path to the log file.

Types

type LogSender

type LogSender interface {
	ShipLogs(ctx context.Context, lines []string) error
}

LogSender is the interface for shipping logs. Avoids import cycle with api package.

type Shipper

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

Shipper captures log output and ships it to the API in batches.

func NewShipper

func NewShipper(sender LogSender, interval time.Duration) *Shipper

NewShipper creates a log shipper that batches and sends logs.

func (*Shipper) Start

func (s *Shipper) Start(ctx context.Context)

Start begins the shipping loop. Call in a goroutine.

func (*Shipper) Write

func (s *Shipper) Write(p []byte) (n int, err error)

Write implements io.Writer so it can be used as a zerolog output.

Jump to

Keyboard shortcuts

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