xlog

package
v0.0.0-...-77b3bd0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FormatText = "text"
	FormatJSON = "json"
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

func Error

func Error(msg string, fields ...zap.Field)

func Fatal

func Fatal(msg string, fields ...zap.Field)

func GetLogger

func GetLogger(opts ...zap.Option) *zap.Logger

func Info

func Info(msg string, fields ...zap.Field)

func InitLog

func InitLog(opts ...Option) error

func Panic

func Panic(msg string, fields ...zap.Field)

func Sync

func Sync() error

func Warn

func Warn(msg string, fields ...zap.Field)

Types

type LogConfig

type LogConfig struct {
	LogPath    string // file path, if empty console will be used
	LogLevel   string // level
	Compress   bool   // compress or not
	MaxSize    int    // log size (MB)
	MaxAge     int    // lifecycle (day)
	MaxBackups int    // backup nums
	Format     string // text or json
}

type Option

type Option func(cfg *LogConfig)

Jump to

Keyboard shortcuts

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