Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zap): silent zap logging #308

Merged
merged 3 commits into from
Mar 24, 2023
Merged

Conversation

IvanMaidurov
Copy link
Contributor

@IvanMaidurov IvanMaidurov commented Dec 16, 2022

Logger will write to output only if error occurred during request

Closes #311

@IvanMaidurov IvanMaidurov force-pushed the feature/silent_zap_logging branch 6 times, most recently from 493d7f8 to 02381b1 Compare December 16, 2022 16:08
@IvanMaidurov
Copy link
Contributor Author

easy test with no parallel requests but with parallel writings:

name              old time/op    new time/op    delta
Log/spam_test-10     2.28s ± 1%     0.45s ±77%   -80.29%  (p=0.000 n=10+10)

name              old alloc/op   new alloc/op   delta
Log/spam_test-10    95.0MB ± 1%   216.7MB ± 0%  +128.20%  (p=0.000 n=9+10)

name              old allocs/op  new allocs/op  delta
Log/spam_test-10     1.33M ± 1%     1.39M ± 1%    +4.43%  (p=0.000 n=10+10)

100 parallel requests, each. with 300 parallel writes:

name              old time/op    new time/op    delta
Log/spam_test-10     2.02s ± 1%     2.13s ± 1%     +5.36%  (p=0.000 n=10+10)

name              old alloc/op   new alloc/op   delta
Log/spam_test-10     198MB ± 1%   11409MB ± 0%  +5657.54%  (p=0.000 n=10+9)

name              old allocs/op  new allocs/op  delta
Log/spam_test-10     3.20M ± 0%     6.07M ± 0%    +89.84%  (p=0.000 n=10+10)

@IvanMaidurov IvanMaidurov marked this pull request as ready for review January 12, 2023 14:49
app.go Show resolved Hide resolved
core/silentlogger/module.go Outdated Show resolved Hide resolved
core/silentlogger/module.go Outdated Show resolved Hide resolved
@bastianccm bastianccm enabled auto-merge (squash) March 24, 2023 08:47
@bastianccm bastianccm merged commit c91a24b into master Mar 24, 2023
@bastianccm bastianccm deleted the feature/silent_zap_logging branch March 24, 2023 08:49
@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Health
flamingo.me/flamingo/v3/core/auth 13%
flamingo.me/flamingo/v3/core/auth/fake 50%
flamingo.me/flamingo/v3/core/auth/http 40%
flamingo.me/flamingo/v3/core/auth/oauth 48%
flamingo.me/flamingo/v3/core/cache 54%
flamingo.me/flamingo/v3/core/gotemplate 87%
flamingo.me/flamingo/v3/core/healthcheck/interfaces/controllers 76%
flamingo.me/flamingo/v3/core/healthcheck 64%
flamingo.me/flamingo/v3/core/internalauth/application 100%
flamingo.me/flamingo/v3/core/internalauth 100%
flamingo.me/flamingo/v3/core/locale/application 87%
flamingo.me/flamingo/v3/core/locale/domain 75%
flamingo.me/flamingo/v3/core/locale/interfaces/controllers 100%
flamingo.me/flamingo/v3/core/locale/interfaces/templatefunctions 92%
flamingo.me/flamingo/v3/core/locale 59%
flamingo.me/flamingo/v3/core/oauth/application 4%
flamingo.me/flamingo/v3/core/oauth/domain 62%
flamingo.me/flamingo/v3/core/oauth 55%
flamingo.me/flamingo/v3/core/requestlogger 100%
flamingo.me/flamingo/v3/core/requesttask 10%
flamingo.me/flamingo/v3/core/robotstxt 50%
flamingo.me/flamingo/v3/core/runtime 77%
flamingo.me/flamingo/v3/core/security/application/role 95%
flamingo.me/flamingo/v3/core/security/application 98%
flamingo.me/flamingo/v3/core/security/application/voter 100%
flamingo.me/flamingo/v3/core/security/interface/controller 100%
flamingo.me/flamingo/v3/core/security/interface/middleware 72%
flamingo.me/flamingo/v3/core/security 59%
flamingo.me/flamingo/v3/core/zap 43%
flamingo.me/flamingo/v3/framework/cmd 12%
flamingo.me/flamingo/v3/framework/config 49%
flamingo.me/flamingo/v3/framework/flamingo 30%
flamingo.me/flamingo/v3/framework 29%
flamingo.me/flamingo/v3/framework/opencensus 88%
flamingo.me/flamingo/v3/framework/prefixrouter 43%
flamingo.me/flamingo/v3/framework/systemendpoint 27%
flamingo.me/flamingo/v3/framework/testutil 0%
flamingo.me/flamingo/v3/framework/web 49%
Summary 49% (3278 / 6678)

@github-actions github-actions bot mentioned this pull request Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ApplicationOption to specify logger (and others?)
2 participants