Skip to content

Conversation

@themuffinator
Copy link
Owner

Summary

  • protect logger configuration updates with a mutex and log level with an atomic
  • guard initialization, log level changes, and sink formatting through thread-safe snapshots
  • add a concurrency-focused logger test covering sink formatting stability

Testing

  • g++ -std=c++23 -Isrc -pthread src/shared/logger.cpp tests/test_logger_thread_safety.cpp -o /tmp/test_logger

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +90 to +92
std::scoped_lock lock(g_sinkMutex);
assert(!g_printMessages.empty());
assert(!g_errorMessages.empty());

Choose a reason for hiding this comment

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

P1 Badge Update thread safety test to drive error sink

The new thread-safety test asserts g_errorMessages is non-empty, but the only logging performed in this test uses worr::Log (lines 64‑67), which routes messages to the print sink only; the error sink is driven exclusively by LoggerError. Because CollectError is never invoked, g_errorMessages will always remain empty and the assertion here fails deterministically. The test needs to call LoggerError (or drop the assertion) to reflect the logger API.

Useful? React with 👍 / 👎.

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.

2 participants