log

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ErrorContextKey field name of the error in the context, if provided this error will be logged.
	ErrorContextKey = "request_error"

	// RequestIDHeaderName header name of the request ID value.
	RequestIDHeaderName = "X-Request-ID"
)

Variables

Main : main logger of the application

Functions

func DatabaseError

func DatabaseError(err error, collection string)

DatabaseError logs a database error.

func Debug

func Debug(args ...interface{})

Debug shorthand

func Error

func Error(args ...interface{})

Error shorthand

func Fatal

func Fatal(args ...interface{})

Fatal shorthand

func Info

func Info(args ...interface{})

Info shorthand

func Initialize

func Initialize(serverName string, productionEnvironment bool)

Initialize initialize the main logger of the application.

func InjectRequestLogger

func InjectRequestLogger(logResponseBody bool) gin.HandlerFunc

InjectRequestLogger log the requests and the responses.

func Panic

func Panic(args ...interface{})

Panic shorthand

func Print

func Print(args ...interface{})

Print shorthand

func Warn

func Warn(args ...interface{})

Warn shorthand

func Warning

func Warning(args ...interface{})

Warning shorthand

func WithField

func WithField(key string, value interface{}) *logrus.Entry

WithField shorthand

func WithFields

func WithFields(fields logrus.Fields) *logrus.Entry

WithFields shorthand

Types

This section is empty.

Jump to

Keyboard shortcuts

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