logging

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: Apache-2.0 Imports: 7 Imported by: 52

Documentation

Overview

Package logging sets up and configures logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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(debug bool) *zap.SugaredLogger

NewLogger creates a new logger with the given configuration.

func TraceFromContext added in v0.6.0

func TraceFromContext(ctx context.Context) []zap.Field

TraceFromContext adds the correct Stackdriver trace fields.

see: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry

func WithLogger

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

WithLogger creates a new context with the provided logger attached.

Types

This section is empty.

Jump to

Keyboard shortcuts

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