Documentation ¶
Index ¶
- Constants
- func Error(err error)
- func ErrorWithoutRequest(err error)
- func Fatal(fatal string)
- func GetDefaultFields() logrus.Fields
- func GetLogEntry(r *http.Request) logrus.FieldLogger
- func Info(info string)
- func Init(opts ...*LoggerOptions) func(next http.Handler) http.Handler
- func LogEntrySetField(r *http.Request, key string, value interface{})
- func LogEntrySetFields(r *http.Request, fields map[string]interface{})
- func NewStructuredLogger(logrusLogger *logrus.Logger) func(next http.Handler) http.Handler
- func Warning(warning string)
- type GormLogger
- func (l GormLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (l GormLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (l GormLogger) LogMode(level logger.LogLevel) logger.Interface
- func (l GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l GormLogger) Warn(ctx context.Context, msg string, data ...interface{})
- type LoggerOptions
- type StructuredLogger
- type StructuredLoggerEntry
Constants ¶
View Source
const ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BlueBold = "\033[34;1m" MagentaBold = "\033[35;1m" RedBold = "\033[31;1m" YellowBold = "\033[33;1m" )
Colors
Variables ¶
This section is empty.
Functions ¶
func ErrorWithoutRequest ¶ added in v0.0.79
func ErrorWithoutRequest(err error)
func GetDefaultFields ¶
func GetLogEntry ¶
func GetLogEntry(r *http.Request) logrus.FieldLogger
func LogEntrySetField ¶
func LogEntrySetFields ¶
func NewStructuredLogger ¶
Types ¶
type GormLogger ¶
GormLogger custom logger for gorm queries
func NewGormLogger ¶
func NewGormLogger(config logger.Config) GormLogger
NewGormLogger get new gorm logger
func (GormLogger) Error ¶
func (l GormLogger) Error(ctx context.Context, msg string, data ...interface{})
Error print error messages
func (GormLogger) Info ¶
func (l GormLogger) Info(ctx context.Context, msg string, data ...interface{})
Info print info
func (GormLogger) LogMode ¶
func (l GormLogger) LogMode(level logger.LogLevel) logger.Interface
LogMode log mode
type LoggerOptions ¶ added in v0.0.98
type LoggerOptions struct {
DisableFatalExit bool
}
type StructuredLogger ¶
func (*StructuredLogger) NewLogEntry ¶
func (l *StructuredLogger) NewLogEntry(r *http.Request) middleware.LogEntry
type StructuredLoggerEntry ¶
type StructuredLoggerEntry struct {
Logger logrus.FieldLogger
}
func (*StructuredLoggerEntry) Panic ¶
func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte)
Click to show internal directories.
Click to hide internal directories.