loggermeta

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 1 Imported by: 20

Documentation

Overview

Package loggermeta stores and accesses the container struct in context.Context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, v *LoggerMeta) context.Context

NewContext returns a new context.Context that carries value v.

Types

type LoggerMeta

type LoggerMeta struct {
	// KeyVals is a mapping of key-value pairs a micro logger adds to the log
	// message issuance.
	KeyVals map[string]string
}

LoggerMeta is a communication structure used to transport information in order for a micro logger to use it when issuing logs.

func FromContext

func FromContext(ctx context.Context) (*LoggerMeta, bool)

FromContext returns the logger struct, if any.

func New

func New() *LoggerMeta

Jump to

Keyboard shortcuts

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