Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

⚡️ simple zap logging middleware for go-chi

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

moul/chizap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

😄 chizap

go.dev referenceLicenseGitHub releaseDocker MetricsMade by Manfred Touron

GoReleasePRGolangCIcodecovGo Report CardCodeFactor

Gitpod ready-to-code

Example

import ("github.com/go-chi/chi""go.uber.org/zap""moul.io/chizap")funcExample() {logger:=zap.NewExample()r:=chi.NewRouter()r.Use(chizap.New(logger,&chizap.Opts{WithReferer:true,WithUserAgent:true,}))}

Usage

FUNCTIONSfunc New(logger*zap.Logger, opts*Opts) func(next http.Handler) http.Handler    New returns a logger middleware for chi, that implements the http.Handler    interface.TYPEStype Opts struct {// WithReferer enables logging the "Referer" HTTP header value.WithReferer bool// WithUserAgent enables logging the "User-Agent" HTTP header value.WithUserAgent bool}    Opts contains the middleware configuration.

Install

Using go

go get moul.io/chizap

Releases

Seehttps://github.com/moul/chizap/releases

Contribute

Contribute <3

I really welcome contributions.Your input is the most precious material.I'm well aware of that and I thank you in advance.Everyone is encouraged to look at what they can do on their own scale;no effort is too small.

Everything on contribution is sum up here:CONTRIBUTING.md

Dev helpers

Pre-commit script for install:https://pre-commit.com

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):


Manfred Touron

🚧📖⚠️💻

moul-bot

🚧

This project follows theall-contributorsspecification. Contributions of any kind welcome!

Stargazers over time

Stargazers over time

License

© 2021Manfred Touron

Licensed under theApache License, Version 2.0(LICENSE-APACHE) or theMIT license(LICENSE-MIT), at your option.See theCOPYRIGHT file for more details.

SPDX-License-Identifier: (Apache-2.0 OR MIT)


[8]ページ先頭

©2009-2025 Movatter.jp