log

package
v0.0.0-...-e8dee01 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(ctx *context.Context, err error, msg string)

Error logs the error with the given message.

func Errorf

func Errorf(ctx *context.Context, err error, msg string, args ...string)

Errorf logs the error with the given formatted message.

func Info

func Info(ctx *context.Context, msg string)

Info logs a non-error message.

func Infof

func Infof(ctx *context.Context, msg string, args ...string)

Infof logs a non-error formatted message.

func Init

func Init(withName string, opts ...zap.Opts)

Init initializes the logger.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger implements log.Logger

func WithValues

func WithValues(keysAndValues map[string]interface{}) *Logger

WithValues creates a new logger with additional key-value pairs in the context

func (*Logger) Error

func (l *Logger) Error(ctx *context.Context, err error, msg string)

Error logs the error with the given message.

func (*Logger) Errorf

func (l *Logger) Errorf(ctx *context.Context, err error, msg string, args ...string)

Errorf logs the error with the given formatted message.

func (*Logger) Info

func (l *Logger) Info(ctx *context.Context, msg string)

Info logs a non-error message.

func (*Logger) Infof

func (l *Logger) Infof(ctx *context.Context, msg string, args ...string)

Infof logs a non-error formatted message.

func (*Logger) WithValues

func (l *Logger) WithValues(keysAndValues map[string]interface{}) *Logger

WithValues creates a new logger with additional key-value pairs in the context

Jump to

Keyboard shortcuts

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