logging

package
v1.46.0 Latest Latest
Warning

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

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

Documentation

Overview

Package logging parses and applies logging configuration

Index

Constants

View Source
const DefaultConfigPath = "./logging.yaml"

DefaultConfigPath is the relative path to the default logging.yaml

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggerConfig

type LoggerConfig struct {
	Output string             `yaml:"output"`
	Level  zapcore.Level      `yaml:"level"`
	File   *lumberjack.Logger `yaml:"file,omitempty"`
}

LoggerConfig is the configuration of a logger.

func NewLoggerConfig

func NewLoggerConfig(configPath string) (*LoggerConfig, error)

NewLoggerConfig returns a logger config. If configPath is not set, stdout logging will be enabled, and a default configuration will be written to ./logging.yaml

func (*LoggerConfig) Options

func (l *LoggerConfig) Options() ([]zap.Option, error)

Options returns the LoggerConfig's zap logging options.

Jump to

Keyboard shortcuts

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