logger

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLogPath = "./logs/micro.log"

Variables

This section is empty.

Functions

func NewJSONLogger

func NewJSONLogger(opts ...Option) *zap.SugaredLogger

初始化 logger

Types

type Option

type Option func(*option)

Option custom setup config

func WithDebugLevel

func WithDebugLevel() Option

WithDebugLevel only greater than 'level' will output

func WithErrorLevel

func WithErrorLevel() Option

WithErrorLevel only greater than 'level' will output

func WithField added in v1.0.10

func WithField(key, value string) Option

WithField add field(s) to log

func WithInfoLevel

func WithInfoLevel() Option

WithInfoLevel only greater than 'level' will output

func WithLogPath

func WithLogPath(path string) Option

func WithWarnLevel

func WithWarnLevel() Option

WithWarnLevel only greater than 'level' will output

Jump to

Keyboard shortcuts

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