logger

package
v0.0.0-...-58191dd Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const JsonFormat = "JSON"

Variables

This section is empty.

Functions

func GetRequestId

func GetRequestId(ctx context.Context) string

GetRequestId get context value from key "system-request-id"

func New

func New(config *Config) model.Logger

New creates a new Logger from some configuration

func SetRequestId

func SetRequestId(ctx context.Context, id string) context.Context

SetRequestId set given id as "system-request-id". If id is "", set a random uuid value

Types

type Config

type Config struct {
	ServiceName     string
	EnvironmentName string
	LogLevel        string
	LogFormat       string
	DefaultFields   map[string]interface{}
}

Config is used to configure the Logger

type Fields

type Fields map[string]interface{}

Jump to

Keyboard shortcuts

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