logger

package
v0.0.0-...-e368295 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConsoleEncodingConfig = zapcore.EncoderConfig{
	MessageKey:     "msg",
	LevelKey:       "level",
	TimeKey:        "ts",
	NameKey:        "name",
	CallerKey:      "caller",
	StacktraceKey:  "stacktrace",
	LineEnding:     zapcore.DefaultLineEnding,
	EncodeLevel:    zapcore.CapitalColorLevelEncoder,
	EncodeTime:     zapcore.ISO8601TimeEncoder,
	EncodeDuration: zapcore.SecondsDurationEncoder,
	EncodeCaller:   zapcore.ShortCallerEncoder,
}

Functions

func ConfigConsoleOutput

func ConfigConsoleOutput(config zapcore.EncoderConfig, level zapcore.Level) zapcore.Core

ConfigConsoleOutput ConsoleEncoding Configuration

func ConfigFileRotationOutput

func ConfigFileRotationOutput(config zapcore.EncoderConfig, jackConfig *lumberjack.Logger, level zapcore.Level) zapcore.Core

ConfigFileRotationOutput RotationFileEncoding Configuration

func CreateCombineLogger

func CreateCombineLogger(config *lumberjack.Logger) *zap.Logger

CreateCombineLogger Create a merged Logger instance

func CreateConsoleLogger

func CreateConsoleLogger() *zap.Logger

func CreateDefaultLogger

func CreateDefaultLogger() *zap.Logger

func CreateFileRotationLogger

func CreateFileRotationLogger(config *lumberjack.Logger) *zap.Logger

func InitLogger

func InitLogger(config Config) *zap.Logger

func ToString

func ToString(logger *lumberjack.Logger) string

Types

type Config

type Config struct {
	ConsoleLogLevel  string             `mapstructure:"console_level"`
	FileLogLevel     string             `mapstructure:"file_level"`
	Selector         []string           `mapstructure:"debug_selector"`
	LumberJackConfig *lumberjack.Logger `mapstructure:"file_rotation"`
}

Jump to

Keyboard shortcuts

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