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

Restore padding #4

Closed
wants to merge 1 commit into from
Closed

Restore padding #4

wants to merge 1 commit into from

Conversation

nervo
Copy link
Contributor

@nervo nervo commented Nov 4, 2022

Introduce a new RestorePadding method, the exact opposite of ResetPadding, which set the padding at the same value it was juste before being resetted.

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

log.Info("some trivial info")

// Reset padding to highlight warning
log.ResetPadding()
log.Warn("be careful !!!")

// Restore padding to carry on as if nothing had happened
log.RestorePadding()

log.Info("some other trivial and boring info")

@nervo nervo mentioned this pull request Nov 6, 2022
@caarlos0
Copy link
Owner

closing in favor of #5

@caarlos0 caarlos0 closed this Nov 10, 2022
@nervo nervo deleted the restore-padding branch November 10, 2022 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants