logging

package
v0.0.0-...-6b979cb Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupLogging

func SetupLogging(cfg Config) error

func SetupLoggingWithConsoleTimeStamp

func SetupLoggingWithConsoleTimeStamp(cfg Config) error

Types

type Config

type Config struct {
	// Write to file? if not provided not writing to file
	Filename string `yaml:"filename,omitempty"`
	// Time to wait until old logs are purged. By default no logs are purged
	MaxAge time.Duration `yaml:"maxAge,omitempty"`
	// MaxSize is the maximum size of the file in MB
	MaxSize int `yaml:"maxSize,omitempty"`
	// Write caller file:line and package.function on log entries
	ReportCaller bool `yaml:"reportCaller,omitempty"`
	// one of trace, debug, info, warn, warning, error, fatal, panic
	Level string `yaml:"level,omitempty"`
}

func (*Config) IsValid

func (c *Config) IsValid() error

Jump to

Keyboard shortcuts

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