ptlog

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

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLevel

func ParseLevel(s string) (zapcore.Level, bool)

Types

type LogConfig

type LogConfig struct {
	Path      string
	Name      string
	MaxSize   int `yaml:"max_size"`
	MaxBackup int `yaml:"max_backup"`
	Level     string
}

func (*LogConfig) Filename

func (c *LogConfig) Filename() string

func (*LogConfig) ZapLevel

func (c *LogConfig) ZapLevel() zapcore.Level

type ZapLogger

type ZapLogger struct {
	*zap.SugaredLogger
	Atom   zap.AtomicLevel
	Logger *zap.Logger
	Writer *lumberjack.Logger
}

func NewConsoleLog

func NewConsoleLog(options ...zap.Option) *ZapLogger

func NewLog

func NewLog(conf LogConfig, options ...zap.Option) (*ZapLogger, error)

Jump to

Keyboard shortcuts

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