logger

package
v0.0.0-...-25a0384 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger        *zap.Logger
	DefaultConfig = Config{
		Level:       "debug",
		Encoding:    "json",
		Development: false,
		FileName:    "logs/infrastructure.log",
		MaxSize:     128,
		MaxBackups:  30,
		MaxAge:      7,
		Compress:    false,
	}
)

Functions

func Debug

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

func Debugf

func Debugf(format string, args ...any)

func Error

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

func Errorf

func Errorf(format string, args ...any)

func Fatal

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

func Fatalf

func Fatalf(format string, args ...any)

func Info

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

func Infof

func Infof(format string, args ...any)

func Init

func Init(cfg Config)

func Panic

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

func Panicf

func Panicf(format string, args ...any)

func Warn

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

func Warnf

func Warnf(format string, args ...any)

Types

type Config

type Config struct {
	Level       string // logger level: debug, info, warn, error, panic, fatal
	Encoding    string // logger encoding: json, console
	Development bool   // development mode
	FileName    string // logger file name
	MaxSize     int    // logger file max size, unit: MB
	MaxBackups  int    // logger file max backups
	MaxAge      int    // logger file max age, unit: day
	Compress    bool   // Compress determines if the rotated logger files should be compressed using gzip.
}

Jump to

Keyboard shortcuts

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