logging

package
v0.0.0-...-0d61532 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultWithFields

func DefaultWithFields(logDetails LogDetails) *logrus.Entry

DefaultWithFields adds default fields to the logger

func Error

func Error(errLog LogDetails)

Error log message with fields

func Errorf

func Errorf(format string, a ...interface{})

Errorf allows you to log formatted strings.

func Fatal

func Fatal(logDetials LogDetails)

Fatal log message

func Fatalf

func Fatalf(format string, a ...interface{})

Fatalf allows you to log formatted strings.

func GenerateUUID

func GenerateUUID() string

GenerateUUID is function to generate our own uuid if the google uuid throws error

func GetRequestID

func GetRequestID(requestIDParams *string) string

GetRequestID is function to generate uuid as request id if client doesn't pass X-REQUEST-ID request header

func GetServiceRequestID

func GetServiceRequestID() string

GetServiceRequestID ..

func Info

func Info(logDetails LogDetails)

Info log messsage

func Infof

func Infof(format string, a ...interface{})

Infof allows you to log formatted strings.

func Trace

func Trace() (line string)

Trace returns the source code line and function name (of the calling function)

Types

type LogDetails

type LogDetails struct {
	Code    string
	Message string
	Details interface{}
	Error   error
}

LogDetails structure for all logrus error and warnings

type UTCFormatter

type UTCFormatter struct {
	log.Formatter
}

UTCFormatter structure for logging

func (UTCFormatter) Format

func (u UTCFormatter) Format(e *log.Entry) ([]byte, error)

Format handler for UTC time - usage: log.SetFormatter(UTCFormatter{&log.JSONFormatter{}})

Jump to

Keyboard shortcuts

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