File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge )] ( LICENSE )
77[ ![ Commitizen friendly] ( https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge )] ( http://commitizen.github.io/cz-cli/ )
8- [ ![ semantic-release] ( https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg )] ( https://github.com/semantic-release/semantic-release?style=for-the-badge )
9- [ ![ Actions Status] ( https://github.com/brpaz/echo-zap /workflows/CI/badge.svg?style=for-the-badge )] ( https://github.com/brpaz/echozap/actions )
8+ [ ![ semantic-release] ( https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge )] ( https://github.com/semantic-release/semantic-release?style=for-the-badge )
9+ [ ![ Actions Status] ( https://github.com/brpaz/echozap /workflows/CI/badge.svg?style=for-the-badge )] ( https://github.com/brpaz/echozap/actions )
1010
1111## Pre-requisites
1212
1717## Usage
1818
1919``` go
20+ package main
21+
2022import (
21- " github.com/labstack/echo/v4"
23+ " net/http"
24+
25+ " github.com/brpaz/echozap"
26+ " github.com/labstack/echo"
2227 " go.uber.org/zap"
23- " github.com/brpaz/echozap"
2428)
2529
2630func main () {
27- e := echo.New ()
28- zapLogger, _ = zap.NewProduction ()
31+ e := echo.New ()
2932
30- e.Use (echozap.ZapLogger (zapLogger))
31- }
33+ zapLogger , _ := zap.NewProduction ()
3234
35+ e.Use (echozap.ZapLogger (zapLogger))
36+
37+ e.GET (" /" , func (c echo.Context ) error {
38+ return c.String (http.StatusOK , " Hello, World!" )
39+ })
40+ e.Logger .Fatal (e.Start (" :1323" ))
41+ }
3342```
3443
3544## Logged details
You can’t perform that action at this time.
0 commit comments