Skip to content

Optimized debug log enable#3596

Merged
merlimat merged 2 commits into
apache:masterfrom
wenbingshen:wenbing/debug_log
Nov 1, 2022
Merged

Optimized debug log enable#3596
merlimat merged 2 commits into
apache:masterfrom
wenbingshen:wenbing/debug_log

Conversation

@wenbingshen
Copy link
Copy Markdown
Member

Motivation

As the title.

@yaalsn
Copy link
Copy Markdown
Contributor

yaalsn commented Nov 1, 2022

Why not adjust log level to print debug logs?

@wenbingshen
Copy link
Copy Markdown
Member Author

rerun failure checks

@wenbingshen
Copy link
Copy Markdown
Member Author

Why not adjust log level to print debug logs?

@yaalsn Why adjust the log level? Debug logs are generally only dynamically enabled and used when troubleshooting is required.

@hangc0276
Copy link
Copy Markdown
Contributor

@wenbingshen Would you please explain the improvements of this change?

@merlimat
Copy link
Copy Markdown
Contributor

merlimat commented Nov 1, 2022

@hangc0276 the log.debug("xxx {}", var) is in many cases allocating objects on the heap for the variable arguments, even when the log level is info or above. Using the if (log.isDebugEnabled()) {...} avoids all allocations.

@merlimat merlimat added this to the 4.16.0 milestone Nov 1, 2022
@merlimat merlimat merged commit e672284 into apache:master Nov 1, 2022
@wenbingshen wenbingshen deleted the wenbing/debug_log branch November 2, 2022 02:34
@wenbingshen
Copy link
Copy Markdown
Member Author

@merlimat Thanks for your explanation and review! :)

yaalsn pushed a commit to yaalsn/bookkeeper that referenced this pull request Jan 30, 2023
* Optimized debug log enable

* Unified debug log enable
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
* Optimized debug log enable

* Unified debug log enable
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.

4 participants