doc: Fix logging documentation examples and add macro explanation#342
doc: Fix logging documentation examples and add macro explanation#342
Conversation
xerial
commented
Jan 20, 2026
- Correct source location format to match actual output (- (file:line) at end)
- Replace misleading "Conditional Logging" section with "Zero-Overhead Logging"
- Explain that Scala 3 inline macros handle lazy evaluation automatically
- No need for manual isDebugEnabled checks due to macro-based implementation
- Correct source location format to match actual output (- (file:line) at end) - Replace misleading "Conditional Logging" section with "Zero-Overhead Logging" - Explain that Scala 3 inline macros handle lazy evaluation automatically - No need for manual isDebugEnabled checks due to macro-based implementation
Summary of ChangesHello @xerial, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the logging documentation to provide a more accurate and comprehensive understanding of the logging framework's capabilities. It clarifies how Scala 3 inline macros enable zero-overhead logging with automatic lazy evaluation, thereby simplifying logging practices by removing the need for explicit log level checks. Additionally, it corrects the format of source location examples to align with the actual output. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the logging documentation by clarifying the zero-overhead nature of logging due to Scala 3 macros and correcting the log output examples. The changes are clear, accurate, and make the documentation much more helpful for developers. I have one minor suggestion to add a link to the official Scala documentation to further improve the reader's experience.
| ## Zero-Overhead Logging with Scala Macros | ||
|
|
||
| Avoid expensive computations when log level is disabled: | ||
| The logging methods use Scala 3 `inline` macros, which means: |
There was a problem hiding this comment.
This is a great explanation of the benefits of using macros. To further help readers who might not be familiar with this Scala 3 feature, consider adding a link to the official documentation for inline macros. This will provide valuable context for those who want to understand the underlying mechanism.
| The logging methods use Scala 3 `inline` macros, which means: | |
| The logging methods use Scala 3 [`inline` macros](https://docs.scala-lang.org/scala3/reference/metaprogramming/inline.html), which means: |