Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 814 Bytes

README.md

File metadata and controls

31 lines (19 loc) · 814 Bytes

#ZapWrap

ZapWrap is a very simple wrapper that allows you to use a Zap logger with the Echo framework, or anything else expecting a similar logging interface.

Neither Zap nor Echov2 have stable APIs at this point so this may break and should probably not be used in production at this time. This code itself is also not very well tested either, but it is pretty trivial.

#Example

package main

import (
        "github.com/jmunson/zapwrap"
        "github.com/labstack/echo"
        "github.com/uber-go/zap"
)

func main() {
        e := echo.New()
        log := zap.NewJSON()
        e.SetLogger(zapwrap.Wrap(log))
        e.Logger().Info("Hello!")
        //continue to use both echo and your zap logger as normal
}