log

package module
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 8 Imported by: 2

README

= Go logger utils
---

image:https://img.shields.io/github/go-mod/go-version/itbasis/go-log-utils[GitHub go.mod Go version]
image:https://img.shields.io/badge/godoc-reference-blue.svg[link=https://pkg.go.dev/github.com/itbasis/go-log-utils]
image:https://img.shields.io/github/v/release/itbasis/go-log-utils[GitHub Release]
https://goreportcard.com/report/github.com/itbasis/go-log-utils[image:https://goreportcard.com/badge/github.com/itbasis/go-log-utils[Go Report Card]]

Documentation

Index

Constants

View Source
const (
	MdcServiceName   = "ServiceName"
	MdcSchedulerName = "SchedulerName"
)
View Source
const (
	ReceiveRequest = "Receive request: %++v"
)

Variables

This section is empty.

Functions

func ConfigureDefaultContextLogger

func ConfigureDefaultContextLogger(forcePlainText bool, zapConfig zap.Config) *zap.Logger

func ConfigureDefaultContextLoggerCustomConfig

func ConfigureDefaultContextLoggerCustomConfig(config zap.Config) *zap.Logger

func ConfigureRootLogger

func ConfigureRootLogger(ctx context.Context, serviceName string, zapConfig zap.Config) (*zap.Logger, error)

func ConfigureRootLoggerWithConfig

func ConfigureRootLoggerWithConfig(serviceName string, zapConfig zap.Config, config Config) (*zap.Logger, error)

Types

type Config

type Config struct {
	LogRootLevel      zapcore.Level `env:"LOG_ROOT_LEVEL" envDefault:"info"`
	LogForcePlainText bool          `env:"LOG_FORCE_PLAIN_TEXT"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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