logger

package
v1.119.11 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(ball *mud.Ball)

Module is a mud module that provides a logger.

func NamedLog

func NamedLog(base *zap.Logger, name string, customLevel string) *zap.Logger

NamedLog creates a new named logger, supporting custom log levels.

func NewLogger

func NewLogger(cfg Config, logger RootLogger) mud.Injector[*zap.Logger]

NewLogger creates a new logger.

func NewZapConfig

func NewZapConfig(config Config) (*zap.Config, error)

NewZapConfig creates a new ZapConfig.

Types

type Config

type Config struct {
	Level       string `help:"the minimum log level to log" default:"info"`
	Development bool   `help:"if true, set logging to development mode" default:"false"`
	Caller      bool   `help:"if true, log function filename and line number" default:"false"`
	Stack       bool   `help:"if true, log stack traces" default:"false"`
	Encoding    string `help:"configures log encoding. can either be 'console', 'json', 'pretty', or 'gcloudlogging'." default:"console"`
	Output      string `help:"can be stdout, stderr, or a filename" default:"stderr"`

	CustomLevel string `` /* 168-byte string literal not displayed */
}

Config is the configuration for the logging.

type RootLogger

type RootLogger struct {
	*zap.Logger
}

RootLogger is a wrapper type to register the root logger.

func NewRootLogger

func NewRootLogger(config *zap.Config) (RootLogger, error)

NewRootLogger creates the actual logger.

Jump to

Keyboard shortcuts

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