options

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZapCore

func ZapCore(option Options) zapcore.Core

Types

type Option

type Option func(*Options)

func AppName

func AppName(app string) Option

func Compress

func Compress(c bool) Option

func Leve

func Leve(l zapcore.Level) Option

func LocalTime

func LocalTime(l bool) Option

func LogType

func LogType(t Type) Option

func MaxAges

func MaxAges(size int) Option

func MaxBackups

func MaxBackups(size int) Option

func MaxSize

func MaxSize(size int) Option

func Out added in v1.0.1

func Out(o io.Writer) Option

func Path

func Path(p string) Option

type Options

type Options struct {
	Level   zapcore.Level
	AppName string
	LogType Type
	// contains filtered or unexported fields
}

Options 日志配置

func GetOptions

func GetOptions(opts ...Option) Options

func NewOptions

func NewOptions() *Options

func (Options) Build

func (option Options) Build() *zap.Logger

type Type

type Type int
const (
	Console Type = iota
	Elastic
	File
)

Jump to

Keyboard shortcuts

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