logging

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(cfg *LogSettings) (*logrus.Logger, error)

NewLogger creates and configures a new logrus.Logger based on the provided configuration.

Types

type LogSettings

type LogSettings struct {
	LogFile    string  `yaml:"log_file"`
	MaxSize    int     `yaml:"max_size"`
	MaxBackups int     `yaml:"max_backups"`
	MaxAge     int     `yaml:"max_age"`
	LogLevel   *string `yaml:"log_level"`
}

type SourceFormatter

type SourceFormatter struct {
	// Underlying is the formatter (e.g., &logrus.TextFormatter{}) that we will delegate to.
	Underlying logrus.Formatter
	// AddSpace indicates whether to add an extra newline for readability, typically for text format.
	AddSpace bool
}

SourceFormatter is a custom formatter to control the caller output. It wraps a standard formatter (like TextFormatter or JSONFormatter).

func (*SourceFormatter) Format

func (f *SourceFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format renders a single log entry.

Jump to

Keyboard shortcuts

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