logger

package
v0.0.0-...-868a888 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(arg ...string) *zap.Logger

Logger 获取日志实例

func New

func New(opts ...Option) *logger

New 初始化日志实例

func NewLogger

func NewLogger(cfg zap.Config) (logger *zap.Logger, err error)

NewLogger New is similar to Config.Build except that info and error logs are separated only json/console encoder is supported (zap doesn't provide a way to refer to other encoders)

Types

type Option

type Option func(o *options)

Option 日志配置选项

func SetDebug

func SetDebug(debug bool) Option

SetDebug 设置日志是否开启调试模式

func SetEnv

func SetEnv(env string) Option

SetEnv 设置日志环境变量

func SetOutput

func SetOutput(output bool) Option

SetOutput 设置是否标准输出

func SetPath

func SetPath(path string) Option

SetPath 设置日志路径

Jump to

Keyboard shortcuts

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