logger

package
v2.17.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package logger contains logging utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context) *logrus.Entry

Get returns logrus entry for given context. Set must be called before this method is called.

func MakeRequestID

func MakeRequestID() string

MakeRequestID returns a new request ID.

func Set

func Set(ctx context.Context, requestID string) context.Context

Set returns derived context with set logrus entry with given request ID.

func SetEntry

func SetEntry(ctx context.Context, l *logrus.Entry) context.Context

SetEntry returns derived context with set given logrus entry.

func SetupGlobalLogger

func SetupGlobalLogger()

SetupGlobalLogger configures logrus.StandardLogger() to enable multiline-friendly formatter in both development (with terminal) and production (without terminal).

Types

type GRPC

type GRPC struct {
	*logrus.Entry
}

GRPC is a compatibility wrapper between logrus entry and gRPC logger interface.

func (*GRPC) Info

func (v *GRPC) Info(args ...interface{})

override InfoXXX methods with TraceXXX to keep gRPC and logrus levels in sync

func (*GRPC) Infof

func (v *GRPC) Infof(format string, args ...interface{})

func (*GRPC) Infoln

func (v *GRPC) Infoln(args ...interface{})

func (*GRPC) V

func (v *GRPC) V(l int) bool

V reports whether verbosity level l is at least the requested verbose level.

Jump to

Keyboard shortcuts

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