logex

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(appName string, level zapcore.Level, ec *EncodingConfig) *zap.Logger

Build builds the default zap logger, and sets the global zap logger to the configured logger instance.

func GetLogger added in v0.0.5

func GetLogger(fields ...zap.Field) *zap.Logger

GetLogger returns an instance with some context, expressed as fields

func GetLoggerLevelValue

func GetLoggerLevelValue(loggerLevel string) (zapcore.Level, error)

GetLoggerLevelValue resolves logger level to zap level

func LevelEncoder added in v0.0.13

func LevelEncoder(raw []byte) zapcore.LevelEncoder

LevelEncoder takes a raw string (as []byte) and returnsthe corresponding zapcore.LevelEncoder

Types

type EncodingConfig added in v0.0.13

type EncodingConfig struct {
	// Format
	Format string
	// LevelEncoder defines how level is encoded (colors, lowercase, etc.)
	LevelEncoder zapcore.LevelEncoder // lowercase
}

EncodingConfig represents the needed encoding configuration for logger

Jump to

Keyboard shortcuts

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