log

package
v0.0.0-...-2c6e621 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

Debug log

func Error

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

Error log

func Fatal

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

Fatal log

func GetLogger

func GetLogger() *zap.Logger

GetLogger return appLogger

func Info

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

Info log

func InitAppLogger

func InitAppLogger(c *Config, opts ...zap.Option)

InitAppLogger init default log

func NewLogger

func NewLogger(c *Config, opts ...zap.Option) *zap.Logger

NewLogger return a new logger

func Panic

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

Panic log

func Sync

func Sync()

Sync calls the underlying Core's Sync method, flushing any buffered log entries. Applications should take care to call Sync before exiting.

func Warn

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

Warn log

Types

type Config

type Config struct {
	Level      string
	Path       string
	Encoder    string
	MaxAge     time.Duration `mapstructure:"max_age"`
	RotateTime time.Duration `mapstructure:"rotate_time"`
}

Config for log

Jump to

Keyboard shortcuts

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