logging

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonFormat LogFormat = "json"
	TextFormat LogFormat = "text"
	TimeFormat string    = "2006-01-02T15:04:05.000000"
)

Variables

This section is empty.

Functions

func FromCtx

func FromCtx(ctx context.Context) *zerolog.Logger

FromCtx returns the logger from the context

func GetDefault

func GetDefault() *zerolog.Logger

GetDefault returns the default logger

func New

func New(config Config) zerolog.Logger

New creates a new logger with the provided configuration

func WithLogger added in v0.1.1

func WithLogger(ctx context.Context, logger zerolog.Logger) context.Context

WithLogger returns a new context with the provided logger

Types

type Config added in v0.1.1

type Config struct {
	Format LogFormat
	Level  zerolog.Level
	Output io.Writer
}

type LogFormat

type LogFormat string

Jump to

Keyboard shortcuts

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