log

package
v0.0.0-...-f7471f1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

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

Error logs the error with the given message.

func Errorf

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

Errorf logs the error with the given formatted message.

func Info

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

Info logs a non-error message.

func Infof

func Infof(ctx *gin.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 *gin.Context, err error, msg string)

Error logs the error with the given message.

func (*Logger) Errorf

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

Errorf logs the error with the given formatted message.

func (*Logger) Info

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

Info logs a non-error message.

func (*Logger) Infof

func (l *Logger) Infof(ctx *gin.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