logger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(options *Options) (e error)

Init logger

Types

type Helper

type Helper struct {
	*zap.Logger
	// contains filtered or unexported fields
}
var Logger Helper

Logger logger single

func NewHelper

func NewHelper(options *Options, zapOptions ...zap.Option) *Helper

func (*Helper) Attach

func (l *Helper) Attach(src *Helper)

func (*Helper) ConsoleLevel

func (l *Helper) ConsoleLevel() zap.AtomicLevel

func (*Helper) Detach

func (l *Helper) Detach()

func (*Helper) FileLevel

func (l *Helper) FileLevel() zap.AtomicLevel

type Options

type Options struct {
	// log file name
	Filename string
	// Maximum size of a single log file
	MaxSize int
	// How many log files are saved
	MaxBackups int
	// How many days of logs are kept
	MaxDays int
	// Do you want to output the code location
	Caller bool
	// debug info warn error dpanic panic fatal
	FileLevel string
	// debug info warn error dpanic panic fatal
	ConsoleLevel string
}

Jump to

Keyboard shortcuts

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