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

chore(zerolog): support parse level #47

Merged
merged 1 commit into from
Feb 13, 2023
Merged

chore(zerolog): support parse level #47

merged 1 commit into from
Feb 13, 2023

Conversation

korolev-d-l
Copy link
Contributor

@korolev-d-l korolev-d-l commented Jan 21, 2023

Before:

import (
    ...
    "github.com/gin-contrib/logger"
    "github.com/rs/zerolog"
)
...
logDefaultLevel, err := zerolog.ParseLevel(os.Getenv("LOG_DEFAULT_LEVEL"))
if err != nil {
    ...
}
...
r.Use(logger.SetLogger(
    logger.WithDefaultLevel(logDefaultLevel),
))
...

After

import (
    ...
    "github.com/gin-contrib/logger"
)
...
logDefaultLevel, err := logger.ParseLevel(os.Getenv("LOG_DEFAULT_LEVEL"))
if err != nil {
    ...
}
...
r.Use(logger.SetLogger(
    logger.WithDefaultLevel(logDefaultLevel),
))
...

@appleboy

@appleboy appleboy changed the title parse level chore(zerolog): support parse level Feb 13, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #47 (34be099) into master (1a33159) will increase coverage by 0.04%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   97.47%   97.52%   +0.04%     
==========================================
  Files           2        2              
  Lines         119      121       +2     
==========================================
+ Hits          116      118       +2     
  Misses          2        2              
  Partials        1        1              
Flag Coverage Δ
go- ?
go-1.14 ?
go-1.15 ?
go-1.16 ?
go-1.17 ?
go-1.18 ?
go-1.19 97.52% <100.00%> (+0.04%) ⬆️
macos-latest ?
ubuntu-latest 97.52% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
logger.go 96.55% <100.00%> (+0.08%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@appleboy appleboy merged commit 809ceee into gin-contrib:master Feb 13, 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.

3 participants