log

package
v0.0.0-...-e35233a Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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