customLogger

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, keysAndValues ...interface{})

Debug will accept custom argument pairs that you wish to Log. It will produce a json-encoded string. See: https://godoc.org/go.uber.org/zap

func Error

func Error(msg string, keysAndValues ...interface{})

Error will accept custom argument pairs that you wish to Log. It will produce a json-encoded string. See: https://godoc.org/go.uber.org/zap

func Info

func Info(msg string, keysAndValues ...interface{})

Info will accept custom argument pairs that you wish to Log. It will produce a json-encoded string. See: https://godoc.org/go.uber.org/zap

func NewConfig

func NewConfig() zap.Config

NewConfig is a reasonable development logging configuration. Logging is enabled at DebugLevel and above.

It enables development mode (which makes DPanicLevel logs panic), uses a console encoder, writes to standard error, and disables sampling. Stacktraces are automatically included on logs of WarnLevel and above.

func NewEncoderConfig

func NewEncoderConfig() zapcore.EncoderConfig

NewEncoderConfig returns an opinionated EncoderConfig

func NewLogger

func NewLogger(env string, opts ...Option) debugcore.Logger

NewLogger returns a new logger with customized options.

func Warn

func Warn(msg string, keysAndValues ...interface{})

Warn will accept custom argument pairs that you wish to Log. It will produce a json-encoded string. See: https://godoc.org/go.uber.org/zap

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option overrides behavior of Logger.

func WithExtraFields

func WithExtraFields(fields ...zap.Field) Option

WithExtraFields add extra fields to logger.

func WithIsProduction

func WithIsProduction(b bool) Option

WithIsProduction defines whether it is prod env.

func WithServiceName

func WithServiceName(s string) Option

WithServiceName defines optional service name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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