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

Entry WithoutPadding #5

Merged
merged 1 commit into from Nov 10, 2022
Merged

Entry WithoutPadding #5

merged 1 commit into from Nov 10, 2022

Conversation

nervo
Copy link
Contributor

@nervo nervo commented Nov 6, 2022

Maybe a better approach than #4

Entry struct has his own Padding value, copied from current Logger one during initialization. Applying a WithoutPadding method juste reset it to default value.

log.IncreasePadding()
log.IncreasePadding()
...

log.Info("some trivial info")

// Without padding to highlight warning
log.WithoutPadding.Warn("be careful !!!")

// Carry on as if nothing had happened
log.Info("some other trivial and boring info")

@codecov
Copy link

codecov bot commented Nov 6, 2022

Codecov Report

Base: 86.76% // Head: 87.38% // Increases project coverage by +0.61% 🎉

Coverage data is based on head (2faaaa7) compared to base (e773385).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   86.76%   87.38%   +0.61%     
==========================================
  Files           5        5              
  Lines         204      214      +10     
==========================================
+ Hits          177      187      +10     
  Misses         26       26              
  Partials        1        1              
Impacted Files Coverage Δ
entry.go 84.72% <100.00%> (+1.38%) ⬆️
logger.go 91.89% <100.00%> (+0.22%) ⬆️
pkg.go 87.50% <100.00%> (+0.54%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@caarlos0
Copy link
Owner

ahh noice, yes, I like this better than #4 as well.. will merge this and close the other one.
Thanks!

@caarlos0 caarlos0 merged commit 20f9258 into caarlos0:main Nov 10, 2022
@caarlos0 caarlos0 added the enhancement New feature or request label Nov 10, 2022
@caarlos0 caarlos0 mentioned this pull request Nov 10, 2022
@nervo nervo deleted the without-padding branch December 8, 2022 07:44
@nervo
Copy link
Contributor Author

nervo commented Dec 8, 2022

@caarlos0, 'just wonder if you plan to release a new version :)

@caarlos0
Copy link
Owner

caarlos0 commented Dec 8, 2022

ah, forgot, will do it now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants