Documentation ¶
Overview ¶
Package logging provides logging capability for fupisha api.
Index ¶
- Variables
- func GetLogEntry(r *http.Request) logrus.FieldLogger
- func LogEntrySetField(r *http.Request, key string, value interface{})
- func LogEntrySetFields(r *http.Request, fields map[string]interface{})
- func NewLogger(cfg *config.Config) *logrus.Logger
- func NewStructuredLogger(logger *logrus.Logger) func(next http.Handler) http.Handler
- type StructuredLogger
- type StructuredLoggerEntry
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //Logger is a configured logrus.Logger Logger *logrus.Logger )
Functions ¶
func GetLogEntry ¶
func GetLogEntry(r *http.Request) logrus.FieldLogger
GetLogEntry return the request scoped logrus.FieldLogger.
func LogEntrySetField ¶
LogEntrySetField adds a field to the request scoped logrus.FieldLogger.
func LogEntrySetFields ¶
LogEntrySetFields adds multiple fields to the request scoped logrus.FieldLogger
Types ¶
type StructuredLogger ¶
StructuredLogger is a structured logrus Logger.
func (*StructuredLogger) NewLogEntry ¶
func (l *StructuredLogger) NewLogEntry(r *http.Request) middleware.LogEntry
NewLogEntry sets default request log fields.
type StructuredLoggerEntry ¶
type StructuredLoggerEntry struct {
Logger logrus.FieldLogger
}
StructuredLoggerEntry is a logrus.FieldLogger
func (*StructuredLoggerEntry) Panic ¶
func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte)
Panic prints stack trace
Click to show internal directories.
Click to hide internal directories.