logging

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIdKey key = 0

the value actually doesn't matter, the type alone will guarantee no package gets at this context value

Variables

This section is empty.

Functions

func ChildCtxWithRequestID

func ChildCtxWithRequestID(ctx context.Context, reqId string) context.Context

func GetRequestID

func GetRequestID(ctx context.Context) string

func SetLoglevel

func SetLoglevel(severity string)

func SetupLogging

func SetupLogging(applicationName string, useEcsLogging bool)

Types

type Logger

type Logger interface {
	Debug(format string, v ...interface{})
	Info(format string, v ...interface{})
	Warn(format string, v ...interface{})
	Error(format string, v ...interface{})

	// expected to terminate the process
	Fatal(format string, v ...interface{})
}

func LoggerFromContext

func LoggerFromContext(ctx context.Context) Logger

func NewLogger

func NewLogger() Logger

func NewNoopLogger

func NewNoopLogger() Logger

Jump to

Keyboard shortcuts

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