Skip to content

ZapWrap is a simple wrapper to use the logger uber-go/zap in the Echo framework

License

Notifications You must be signed in to change notification settings

jmunson/zapwrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

#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
}

About

ZapWrap is a simple wrapper to use the logger uber-go/zap in the Echo framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages