log

package
v0.0.0-...-17837d5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STDERR = "stderr"
	FILE   = "file"
)

Variables

This section is empty.

Functions

func SetupLoggers

func SetupLoggers(logType, logDir, logLevel string) (err error)

Types

type Configuration

type Configuration struct {
	LogType    string
	LogFileDir string
	LogLevel   string
	MaxSize    int
	MaxAge     int
	MaxBackups int
	Compress   bool
}

type LoggerInterface

type LoggerInterface interface {
	LogDebug(msg string, fields ...zap.Field)
	LogDebugWithCtx(ctx context.Context, msg string, fields ...zap.Field)
	LogInfo(msg string, fields ...zap.Field)
	LogInfoWithCtx(ctx context.Context, msg string, fields ...zap.Field)
	LogError(msg string, fields ...zap.Field)
	LogErrorWithCtx(ctx context.Context, msg string, fields ...zap.Field)
	LogWarn(msg string, fields ...zap.Field)
	LogWarnWithCtx(ctx context.Context, msg string, fields ...zap.Field)
	AddLoggerCtx(ctx context.Context, key, value interface{}) context.Context
	GetLoggerFromCtx(ctx context.Context) *zap.Logger
}
var (
	Logger LoggerInterface
)

func NewZapLogger

func NewZapLogger(c *Configuration) (LoggerInterface, error)

Jump to

Keyboard shortcuts

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