logging

package
v0.0.0-...-2950954 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCloser

type ErrCloser struct {
	Errors []error
}

func (*ErrCloser) Error

func (e *ErrCloser) Error() string

type Field

type Field = zap.Field

func Any

func Any(key string, data any) Field

func Bool

func Bool(key string, data bool) Field

func Error

func Error(key string, data error) Field

func Float64

func Float64(key string, data float64) Field

func Int

func Int(key string, data int) Field

func Int64

func Int64(key string, data int64) Field

func String

func String(key, data string) Field

func Uint

func Uint(key string, data uint) Field

func Uint64

func Uint64(key string, data uint64) Field

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(logLevel string) (*Logger, error)

If logLevel is not valid, it will be set to debug.

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) DPanic

func (l *Logger) DPanic(msg string, fields ...Field)

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...Field)

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...Field)

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, fields ...Field)

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...Field)

func (*Logger) NewEchoMiddleware

func (l *Logger) NewEchoMiddleware(next echo.HandlerFunc) echo.HandlerFunc

func (*Logger) NewHTTPMiddleware

func (l *Logger) NewHTTPMiddleware(next http.Handler) http.Handler

func (*Logger) Panic

func (l *Logger) Panic(msg string, fields ...Field)

func (*Logger) Sync

func (l *Logger) Sync() error

Sync flushes any buffered log entries. It might be a good idea to call Sync before exiting your program. Or defer it in the beginning of your handlers.

func (*Logger) TraceQueryEnd

func (l *Logger) TraceQueryEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryEndData)

func (*Logger) TraceQueryStart

func (l *Logger) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...Field)

Jump to

Keyboard shortcuts

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