log

package
v0.0.0-...-690bb9c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPrefixLength = 53

DefaultPrefixLength is the length of the log prefix that we have to strip out

View Source
const OutputCallDepth = 6

OutputCallDepth is the stack depth where we can find the origin of this call

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 InfoEchof

func InfoEchof(ctx echo.Context, msg string, args ...string)

InfoEchof logs a non-error formatted message for echo events.

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) InfoEchof

func (l *Logger) InfoEchof(ctx echo.Context, msg string, args ...string)

InfoEchof logs a non-error formatted message for echo events.

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