Back to

Package lecho

Latest Go to latest

The latest major version is v3.

Published: Jul 31, 2020 | License: MIT | Module:


func Middleware

func Middleware(config Config) echo.MiddlewareFunc

type Config

type Config struct {
	Logger  *Logger
	Skipper middleware.Skipper

type Context

type Context struct {
	// contains filtered or unexported fields

func NewContext

func NewContext(ctx echo.Context, logger *Logger) *Context

func (*Context) Logger

func (c *Context) Logger() echo.Logger

type Logger

type Logger struct {
	// contains filtered or unexported fields

Logger is a wrapper around `zerolog.Logger` that provides an implementation of `echo.Logger` interface

func Ctx

func Ctx(ctx context.Context) *Logger

func New

func New(logger *zerolog.Logger, setters ...Setter) *Logger

New returns a new Logger instance

func (Logger) Clone

func (l Logger) Clone(setters ...Setter) *Logger

func (Logger) Debug

func (l Logger) Debug(i ...interface{})

func (Logger) Debugf

func (l Logger) Debugf(format string, i ...interface{})

func (Logger) Debugj

func (l Logger) Debugj(j log.JSON)

func (Logger) Error

func (l Logger) Error(i ...interface{})

func (Logger) Errorf

func (l Logger) Errorf(format string, i ...interface{})

func (Logger) Errorj

func (l Logger) Errorj(j log.JSON)

func (Logger) Fatal

func (l Logger) Fatal(i ...interface{})

func (Logger) Fatalf

func (l Logger) Fatalf(format string, i ...interface{})

func (Logger) Fatalj

func (l Logger) Fatalj(j log.JSON)

func (Logger) Info

func (l Logger) Info(i ...interface{})

func (Logger) Infof

func (l Logger) Infof(format string, i ...interface{})

func (Logger) Infoj

func (l Logger) Infoj(j log.JSON)

func (Logger) Level

func (l Logger) Level() log.Lvl

func (Logger) Output

func (l Logger) Output() io.Writer

func (Logger) Panic

func (l Logger) Panic(i ...interface{})

func (Logger) Panicf

func (l Logger) Panicf(format string, i ...interface{})

func (Logger) Panicj

func (l Logger) Panicj(j log.JSON)

func (Logger) Prefix

func (l Logger) Prefix() string

func (Logger) Print

func (l Logger) Print(i ...interface{})

func (Logger) Printf

func (l Logger) Printf(format string, i ...interface{})

func (Logger) Printj

func (l Logger) Printj(j log.JSON)

func (Logger) SetHeader

func (l Logger) SetHeader(h string)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level log.Lvl)

func (*Logger) SetOutput

func (l *Logger) SetOutput(newOut io.Writer)

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(newPrefix string)

func (Logger) Warn

func (l Logger) Warn(i ...interface{})

func (Logger) Warnf

func (l Logger) Warnf(format string, i ...interface{})

func (Logger) Warnj

func (l Logger) Warnj(j log.JSON)

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) context.Context

type Options

type Options struct {
	// contains filtered or unexported fields

type Setter

type Setter func(opts *Options)

func WithCaller

func WithCaller() Setter

func WithCallerWithSkipFrameCount

func WithCallerWithSkipFrameCount(skipFrameCount int) Setter

func WithField

func WithField(name string, value interface{}) Setter

func WithFields

func WithFields(fields map[string]interface{}) Setter

func WithHook

func WithHook(hook zerolog.Hook) Setter

func WithHookFunc

func WithHookFunc(hook zerolog.HookFunc) Setter

func WithLevel

func WithLevel(level log.Lvl) Setter

func WithPrefix

func WithPrefix(prefix string) Setter

func WithTimestamp

func WithTimestamp() Setter

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier