logging

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggerFactory

type LoggerFactory interface {
	NewNamedLogger(name string) zerolog.Logger
	Level() zerolog.Level
	IsStructuredLogging() bool
}

LoggerFactory is a factory that can be used to create named loggers using the same aligned configuration and namespace.

func New

func New(structuredLogging, unixTimeStamp, disableColoredLogs bool, options ...Option) LoggerFactory

New creates a new LoggerFactory which then can be used to create configured named loggers (log channels)

Example
// create the factory
loggingFactory := New(true, false, false)

// create new named logger
logger := loggingFactory.NewNamedLogger("MyLogger")
logger.Info().Msg("Hello World")

type Option added in v0.0.7

type Option func(*loggerFactoryImpl)

Option is the struct for defining optional parameters for LoggerFactory

func Level added in v0.0.7

func Level(level zerolog.Level) Option

Level sets the log-level used for the loggers created through this factory

Jump to

Keyboard shortcuts

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