Skip to content

doc: Fix logging documentation examples and add macro explanation#342

Merged
xerial merged 4 commits intomainfrom
claude/fix-logging-examples-Jg1Jw
Jan 20, 2026
Merged

doc: Fix logging documentation examples and add macro explanation#342
xerial merged 4 commits intomainfrom
claude/fix-logging-examples-Jg1Jw

Conversation

@xerial
Copy link
Copy Markdown
Member

@xerial 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
@github-actions github-actions Bot added bug Something isn't working doc Improvements or additions to documentation labels Jan 20, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Documentation Correction: Updated logging documentation to accurately reflect the source location format in log outputs and to better explain the benefits of Scala 3 inline macros.
  • Zero-Overhead Logging: The 'Conditional Logging' section has been replaced with 'Zero-Overhead Logging with Scala Macros' to highlight how Scala 3's inline macros provide automatic lazy evaluation and zero runtime cost for disabled log levels.
  • Macro Explanation: Added detailed explanations on how Scala 3 inline macros handle lazy evaluation automatically, eliminating the need for manual isDebugEnabled checks in logging statements.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@xerial xerial enabled auto-merge (squash) January 20, 2026 05:53
@xerial xerial merged commit 5ee551f into main Jan 20, 2026
13 checks passed
@xerial xerial deleted the claude/fix-logging-examples-Jg1Jw branch January 20, 2026 05:53
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/core/logging.md
## Zero-Overhead Logging with Scala Macros

Avoid expensive computations when log level is disabled:
The logging methods use Scala 3 `inline` macros, which means:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working doc Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants