文件名称:logger:用于zap的简单go-chi日志记录中间件
文件大小:2KB
文件格式:ZIP
更新时间:2024-05-28 10:25:48
middleware zap syslog go-chi Go
记录器 用于zap的简单go-chi日志记录中间件 安装 go get github.com/treastech/logger 用法 package main import ( l "github.com/treastech/logger" "github.com/go-chi/chi" "go.uber.org/zap" "net/http" ) func main () { logger , _ := zap . NewProduction () defer logger . Sync () // flushes buffer, if any r := chi . NewRouter () // instead of // r.Use(middleware.Logger) // use r . Use ( l . Logger ( logger )) r .
【文件预览】:
logger-master
----LICENSE(1KB)
----logger.go(907B)
----.gitignore(7B)
----README.md(1KB)