log

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFatal

func CheckFatal(location string, err error, logger log.Logger)

CheckFatal prints an error and exits with error code 1 if err is non-nil

func InitLogger

func InitLogger(cfg *server.Config) log.Logger

InitLogger initialises the global gokit logger (util_log.Logger) and overrides the default logger for the server.

func NewDefaultLogger

func NewDefaultLogger(l logging.Level, format logging.Format) log.Logger

NewDefaultLogger creates a new gokit logger with the configured level and format

func WithContext

func WithContext(ctx context.Context, l kitlog.Logger) kitlog.Logger

WithContext returns a Logger that has information about the current user in its details.

e.g. log := util.WithContext(ctx) log.Errorf("Could not chunk chunks: %v", err)

func WithSourceIPs

func WithSourceIPs(sourceIPs string, l kitlog.Logger) kitlog.Logger

WithSourceIPs returns a Logger that has information about the source IPs in its details.

func WithTraceID

func WithTraceID(traceID string, l kitlog.Logger) kitlog.Logger

WithTraceID returns a Logger that has information about the traceID in its details.

func WithUserID

func WithUserID(userID string, l kitlog.Logger) kitlog.Logger

WithUserID returns a Logger that has information about the current user in its details.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳