logging

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package loggin sets up an configures logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger *zap.SugaredLogger) context.Context

ContextWithLogger creates a new context with the provided logger attached.

func DefaultLogger

func DefaultLogger() *zap.SugaredLogger

DefaultLogger returns the default logger for the package.

func FromContext

func FromContext(ctx context.Context) *zap.SugaredLogger

FromContext returns the logger stored in the context. If no such logger exists, a default logger is returned.

func NewLogger

func NewLogger(level string, development bool) *zap.SugaredLogger

NewLogger creates a new logger with the given configuration.

func NewLoggerFromEnv

func NewLoggerFromEnv() *zap.SugaredLogger

NewLoggerFromEnv creates a new logger from the einvironment. It consumes LOG_LEVEL for determining the level and LOG_MODE for determining the output parameters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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