ech0

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

Ech0

Ech0 (pronounced "echo zero") is a logging adapter for echo.Logger that uses github.com/rs/zerolog as the logging backend instead of the default github.com/labstack/gommon/log

Why?

  1. I like Echo.
  2. I like zerolog.
  3. I wanted to have one logging backend in my Echo apps.

Installing

go get -u github.com/dvelitchkov/ech0

Benchmarks

goos: darwin
goarch: amd64
pkg: github.com/dvelitchkov/ech0
BenchmarkZeroFormat-8     	 1000000	      1915 ns/op	     533 B/op	       3 allocs/op
BenchmarkZeroJSON-8       	 1000000	      2249 ns/op	    1032 B/op	       3 allocs/op
BenchmarkZero-8           	 1000000	      1893 ns/op	     533 B/op	       3 allocs/op
BenchmarkGommonFormat-8   	 1000000	      2203 ns/op	     256 B/op	      11 allocs/op
BenchmarkGommonJSON-8     	  500000	      2695 ns/op	     472 B/op	      14 allocs/op
BenchmarkGommon-8         	 1000000	      2136 ns/op	     256 B/op	      11 allocs/op
PASS
ok  	github.com/dvelitchkov/ech0	11.903s

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

Log wraps a zerolog.Logger to provide an `echo.Logger` implementation

func New

func New(pfx string) *Log

New returns a new Log instance with the given prefix

func (Log) Debug

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

Debug satisfies the echo.Logger interface

func (Log) Debugf

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

Debugf satisfies the echo.Logger interface

func (Log) Debugj

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

Debugj satisfies the echo.Logger interface

func (Log) Error

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

Error satisfies the echo.Logger interface

func (Log) Errorf

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

Errorf satisfies the echo.Logger interface

func (Log) Errorj

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

Errorj satisfies the echo.Logger interface

func (Log) Fatal

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

Fatal satisfies the echo.Logger interface

func (Log) Fatalf

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

Fatalf satisfies the echo.Logger interface

func (Log) Fatalj

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

Fatalj satisfies the echo.Logger interface

func (Log) Info

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

Info satisfies the echo.Logger interface

func (Log) Infof

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

Infof satisfies the echo.Logger interface

func (Log) Infoj

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

Infoj satisfies the echo.Logger interface

func (Log) Level

func (l Log) Level() log.Lvl

Level satisfies the echo.Logger interface

func (Log) Output

func (l Log) Output() io.Writer

Output satisfies the echo.Logger interface

func (Log) Panic

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

Panic satisfies the echo.Logger interface

func (Log) Panicf

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

Panicf satisfies the echo.Logger interface

func (Log) Panicj

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

Panicj satisfies the echo.Logger interface

func (Log) Prefix

func (l Log) Prefix() string

Prefix satisfies the echo.Logger interface

func (Log) Print

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

Print satisfies the echo.Logger interface

func (Log) Printf

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

Printf satisfies the echo.Logger interface

func (Log) Printj

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

Printj satisfies the echo.Logger interface

func (*Log) SetLevel

func (l *Log) SetLevel(v log.Lvl)

SetLevel satisfies the echo.Logger interface

func (*Log) SetOutput

func (l *Log) SetOutput(w io.Writer)

SetOutput satisfies the echo.Logger interface

func (*Log) SetPrefix

func (l *Log) SetPrefix(p string)

SetPrefix satisfies the echo.Logger interface

func (Log) Warn

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

Warn satisfies the echo.Logger interface

func (Log) Warnf

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

Warnf satisfies the echo.Logger interface

func (Log) Warnj

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

Warnj satisfies the echo.Logger interface

Jump to

Keyboard shortcuts

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