Skip to content

Conversation

@finger563
Copy link
Contributor

Description

  • Mark logger mutex as mutable so that the various standard (not rate-limited) logging methods can be called from const methods.

Motivation and Context

Allows various BaseComponent derived functions that are const to log messages.

How has this been tested?

Building and running the logger/example

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

Copilot AI review requested due to automatic review settings October 12, 2025 20:31
@github-actions
Copy link

✅Static analysis result - no issues found! ✅

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Logger class to make logging methods callable from const contexts by marking the tag mutex as mutable and adding const qualifiers to standard logging methods.

  • Makes standard logging methods (debug, info, warn, error, format) const-qualified
  • Updates tag mutex to be mutable to allow locking from const methods
  • Replaces std::lock_guard<std::mutex> with std::scoped_lock for better RAII

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@finger563 finger563 self-assigned this Oct 12, 2025
@finger563 finger563 added enhancement New feature or request logger labels Oct 12, 2025
@finger563 finger563 merged commit 3fb544c into main Oct 12, 2025
98 of 99 checks passed
@finger563 finger563 deleted the feat/logger-mutable-mutex branch October 12, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request logger

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants