logging

package
v0.0.0-...-16f8954 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

Debug log message

func Debugf

func Debugf(msg string, args ...interface{})

Debugf log message

func Error

func Error(trace string, err error)

Error log message with fields

func Fatal

func Fatal(args ...interface{})

Fatal log message

func Fatalf

func Fatalf(msg string, args ...interface{})

Fatalf log message

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 Info

func Info(msg string)

Info log message

func Infof

func Infof(msg string, args ...interface{})

Infof log message

func Panic

func Panic(args ...interface{})

Panic log message

func Panicf

func Panicf(msg string, args ...interface{})

Panicf log message

func Printf

func Printf(msg string, args ...interface{})

Printf ...

func Println

func Println(args ...interface{})

Println log message

func StripSpecialChars

func StripSpecialChars(s string) string

StripSpecialChars strips newlines and tabs from a string

func Trace

func Trace() (line string)

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

func Warn

func Warn(msg string)

Warn log message

func Warnf

func Warnf(msg string, args ...interface{})

Warnf log message

func WithError

func WithError(err error) *logrus.Entry

WithError logs a message with the specified error

func WithField

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

WithField log message with field

func WithFields

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

WithFields logs a message with fields

Types

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