log

package
v0.0.0-...-84339fa Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Glob

func Glob() *zap.SugaredLogger

Glob simply returns the global logger

func InitGlobalLogger

func InitGlobalLogger(appCfg *config.AppConfig)

InitGlobalLogger creates a new SugaredLogger and assigns it as the global logger

func SetGlobalLogger

func SetGlobalLogger(l *zap.SugaredLogger)

SetGlobalLogger takes a Logger instance as the input and sets it as the global logger, useful for testing.

func WithContext

func WithContext(ctx context.Context) *zap.SugaredLogger

WithContext returns a zap logger with as much context as possible

Types

type Logger

type Logger interface {
	Debugw(template string, args ...interface{})
	Errorf(template string, args ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	Infof(template string, args ...interface{})
	Infow(template string, args ...interface{})
	Panicf(template string, args ...interface{})
	Warnw(template string, args ...interface{})
	Sync() error
}

Logger interface captures the logging functions exposed for the turing router, abstracting away the underlying logging library.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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