extrazap

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package extrazap provides helper functions for initializing Zap loggers, as well as associating and extracting them with/from context objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachLoggerToContext

func AttachLoggerToContext(l *zap.Logger, ctx context.Context) context.Context

AttachLoggerToContext returns a copy of the given context with the given logger attached to it. Neither the given context nor the given logger are affected.

func ExtractLoggerFromContext

func ExtractLoggerFromContext(ctx context.Context) *zap.Logger

ExtractLoggerFromContext returns the logger attached to the given context, or the global logger if no logger instance was previously attached to it.

func NewDevelopmentLogger

func NewDevelopmentLogger() *zap.Logger

NewDevelopmentLogger builds a customized development logger which is even more user-friendly than zap.NewDevelopment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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