Skip to content

feat: add TRACE log level and patch_logging()#5

Merged
joamag merged 4 commits into
masterfrom
feat/trace-log-level
Apr 8, 2026
Merged

feat: add TRACE log level and patch_logging()#5
joamag merged 4 commits into
masterfrom
feat/trace-log-level

Conversation

@joamag

@joamag joamag commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add TRACE log level (DEBUG - 5 = 5) for fine-grained protocol-level debugging, mirroring the Appier implementation (hivesolutions/appier#84)
  • Add patch_logging() function to register TRACE with Python's logging module (idempotent, guarded by logging._quorum_patched)
  • Add TRACE-aware log format templates with logger name, file path, and line number for maximum debugging detail
  • Add trace() convenience function, is_trace() helper, and TRACE case in _level()
  • Wrap in_signature() return in bool() for type correctness
  • Add 21 new tests covering TRACE constant, level ordering, patch_logging(), _level(), in_signature(), and rotating_handler()

Divergences from Appier

Area Appier Flask-Quorum Reason
DummyLogger.trace() Added Skipped No DummyLogger in flask-quorum
is_trace() App.is_trace() method Module-level is_trace() function Follows flask-quorum's existing pattern (cf. is_devel())
_reload_logging() Updated with TRACE format Skipped No equivalent in flask-quorum
reload_format() Updated with TRACE formats Skipped No equivalent in flask-quorum
Patch guard logging._appier_patched logging._quorum_patched Avoid collision if both used in same process
_level() App._level() classmethod Module-level _level() function Follows flask-quorum's existing pattern

Test plan

  • All 23 log tests pass (PYTHONPATH=src python3 -m unittest quorum.test.log)
  • Full test suite passes (144 tests, 6 pre-existing tinydb failures unrelated)
  • Black formatting verified clean
  • CI pipeline passes

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features
    • Introduced TRACE logging level and new trace() method for TRACE-level messages
    • Added patch_logging() function to register TRACE and custom logging levels
    • New SILENT logging level constant
    • Improved call-site reporting accuracy in logging methods

Add TRACE log level (DEBUG - 5 = 5) for fine-grained protocol-level
debugging, mirroring the implementation in Appier. Includes
patch_logging() to register the level with Python's logging module,
TRACE-aware format templates with file path and line number, and
comprehensive test coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@joamag has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 28 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 28 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eecfad06-28d5-43cb-9027-af3ecdcee11a

📥 Commits

Reviewing files that changed from the base of the PR and between 66122f3 and dd0c7d7.

📒 Files selected for processing (1)
  • src/quorum/log.py
📝 Walkthrough

Walkthrough

A TRACE logging level is introduced alongside a patch_logging() function to register it with Python's logging system. The logging subsystem is updated to support fine-grained protocol-level debugging with appropriate trace-specific format strings, and module exports are expanded to expose the new logging capabilities.

Changes

Cohort / File(s) Summary
TRACE Level Introduction
src/quorum/log.py
Added TRACE constant (logging.DEBUG - 5), trace-specific format strings (LOGGING_FORMAT_TRACE, LOGGING_FORMAT_TRACE_TID), patch_logging() function to register TRACE with Python's logging system and attach a trace() method to loggers, module-level trace() helper function, and stacklevel=2 parameter to existing logging helpers for accurate call-site reporting.
Core Integration & Helpers
src/quorum/base.py
Updated start_log() to use sentinel defaults for format parameters and auto-derive trace-specific formats when log level is <= TRACE. Added is_trace() helper to check if current logger level is <= TRACE. Extended _level() to map string "TRACE" to log.TRACE constant.
Module API Exports
src/quorum/__init__.py
Expanded public re-exports to include is_trace, _level from base, and SILENT, TRACE, patch_logging, trace from log.
Documentation
CHANGELOG.md
Added entry under [Unreleased] → Added documenting the new TRACE log level and patch_logging() capability.
Test Coverage
src/quorum/test/log.py
Added comprehensive tests for TRACE level constants, rotating_handler() behavior, patch_logging() idempotency and level name mappings, logger-level integration with trace method, _level() handling of TRACE and SILENT strings, and in_signature() parameter detection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 With TRACE now set to depths untold,
Our debugging logs are sharp and bold!
Protocol secrets the patch reveals,
Each level mapped with quorum's zeal—
Fine-grained whispers, truth on wheels! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: introducing a TRACE log level and adding a patch_logging() function for fine-grained debugging.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/trace-log-level

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@joamag joamag marked this pull request as ready for review April 8, 2026 16:06
Copilot AI review requested due to automatic review settings April 8, 2026 16:06
Set stacklevel in trace(), debug(), info(), warning(), error(), and
critical() wrapper functions so that %(pathname)s and %(lineno)d report
the actual caller location instead of the wrapper code. Guarded by
sys.version_info >= (3, 8) as stacklevel was introduced in Python 3.8.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@joamag joamag left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM

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

Copy link
Copy Markdown

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.

Reviewed commit: 9f9be744cd

ℹ️ 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 thread src/quorum/base.py
# is idempotent and safe to be called multiple times
log.patch_logging()

is_trace = level <= log.TRACE

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize log level before TRACE comparison

start_log() now does level <= log.TRACE before any normalization, which raises TypeError on Python 3 when callers pass string levels (for example "DEBUG" or "TRACE"). This is a regression from the previous behavior where string levels could flow to logger.setLevel(...) without crashing, and it affects direct users of the public quorum.start_log API.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a new TRACE logging level (numeric value 5) and associated helpers to support very fine-grained debugging in Flask-Quorum’s logging stack, including format templates optimized for protocol-level troubleshooting.

Changes:

  • Added TRACE log level, patch_logging() monkey-patch helper, and trace() convenience logger in quorum.log.
  • Updated start_log() to auto-register TRACE and to switch to TRACE-specific formats when configured at TRACE level.
  • Expanded unit tests to cover TRACE, level mapping, patch_logging(), _level(), in_signature(), and handler helpers.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/quorum/log.py Adds TRACE constants/formats plus patch_logging() and trace() helper functionality.
src/quorum/base.py Calls patch_logging() from start_log(), selects TRACE-aware formats, adds is_trace(), and maps "TRACE" in _level().
src/quorum/test/log.py Adds new tests for TRACE behavior, patching behavior, and logging helpers.
src/quorum/__init__.py Exposes TRACE-related APIs from the package root.
CHANGELOG.md Documents TRACE level and patch_logging() addition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/quorum/log.py
Comment on lines 359 to +366
def in_signature(callable, name):
has_full = hasattr(inspect, "getfullargspec")
if has_full:
spec = inspect.getfullargspec(callable)
else:
spec = inspect.getargspec(callable)
args, _varargs, kwargs = spec[:3]
return (args and name in args) or (kwargs and "secure" in kwargs)
return bool((args and name in args) or (kwargs and "secure" in kwargs))

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

in_signature() is meant to check whether a callable accepts a parameter named by name, but the current implementation hard-codes 'secure' for the **kwargs case (kwargs and 'secure' in kwargs). With inspect.getfullargspec(), kwargs here is the name of the var-keyword parameter (eg 'kwargs'), so this check will almost always be false and doesn’t correctly represent “accepts arbitrary kwargs”. Consider updating this to (a) check name against positional/kw-only args, and (b) treat presence of spec.varkw as accepting the parameter.

Copilot uses AI. Check for mistakes.
Comment thread src/quorum/log.py
Comment on lines +379 to +381
if sys.version_info >= (3, 8):
kwargs.setdefault("stacklevel", 2)
logger.trace(message, *args, **kwargs)

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

trace() calls logger.trace(...) unconditionally. If patch_logging() hasn’t been called yet (eg apps that don’t go through start_log()), this will raise AttributeError because logging.Logger won’t have a trace method. Consider calling patch_logging() inside trace() (idempotent) or falling back to logger.log(TRACE, ...) when .trace is missing.

Suggested change
if sys.version_info >= (3, 8):
kwargs.setdefault("stacklevel", 2)
logger.trace(message, *args, **kwargs)
patch_logging()
if sys.version_info >= (3, 8):
kwargs.setdefault("stacklevel", 2)
if hasattr(logger, "trace"):
logger.trace(message, *args, **kwargs)
else:
logger.log(TRACE, message, *args, **kwargs)

Copilot uses AI. Check for mistakes.
Comment thread src/quorum/log.py
Comment on lines +58 to +63
LOGGING_FORMAT_TRACE_T = "%%(asctime)s [%%(name)s] [%%(levelname)s] %s%%(pathname)s:%%(lineno)d | %%(message)s"
""" The format to be used when the logging level is set to TRACE,
includes file path and line number to allow for fine-grained debugging
of low-level protocol operations """

LOGGING_FORMAT_TRACE_TID_T = "%%(asctime)s [%%(name)s] [%%(levelname)s] %s[%%(thread)d] %%(pathname)s:%%(lineno)d | %%(message)s"

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

The TRACE format templates already include %(name)s, but they are still parameterized with LOGGING_EXTRA (%s). If LOGGING_EXTRA is enabled (it expands to [%(name)s] ), TRACE logs will end up duplicating the logger name segment. Consider not applying LOGGING_EXTRA to TRACE formats (or making TRACE templates omit %(name)s and rely on LOGGING_EXTRA).

Suggested change
LOGGING_FORMAT_TRACE_T = "%%(asctime)s [%%(name)s] [%%(levelname)s] %s%%(pathname)s:%%(lineno)d | %%(message)s"
""" The format to be used when the logging level is set to TRACE,
includes file path and line number to allow for fine-grained debugging
of low-level protocol operations """
LOGGING_FORMAT_TRACE_TID_T = "%%(asctime)s [%%(name)s] [%%(levelname)s] %s[%%(thread)d] %%(pathname)s:%%(lineno)d | %%(message)s"
LOGGING_FORMAT_TRACE_T = "%%(asctime)s [%%(name)s] [%%(levelname)s] %.0s%%(pathname)s:%%(lineno)d | %%(message)s"
""" The format to be used when the logging level is set to TRACE,
includes file path and line number to allow for fine-grained debugging
of low-level protocol operations """
LOGGING_FORMAT_TRACE_TID_T = "%%(asctime)s [%%(name)s] [%%(levelname)s] %.0s[%%(thread)d] %%(pathname)s:%%(lineno)d | %%(message)s"

Copilot uses AI. Check for mistakes.
Comment thread src/quorum/log.py
Comment on lines +88 to 96
TRACE = logging.DEBUG - 5
""" The trace level used for extremely detailed and verbose
logging of protocol-level operations, this is meant to be
used for fine-grained debugging of low-level operations
like raw byte transfers and frame parsing """

LEVELS = ("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL")
""" The sequence of levels from the least sever to the
most sever this sequence may be used to find all the

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

TRACE is introduced, but LEVELS doesn’t include 'TRACE'. As a result, MemoryHandler.get_messages_l() will treat TRACE records as an unknown level and won’t store them in messages_l, so get_latest(level=...) filtering can’t work for TRACE. Consider adding 'TRACE' to LEVELS (and possibly LEVEL_ALIAS) so TRACE messages participate in severity filtering consistently.

Copilot uses AI. Check for mistakes.
Comment thread src/quorum/base.py
Comment on lines +686 to +697
# patches the logging infra-structure so that the TRACE level
# is properly registered and available for usage, this call
# is idempotent and safe to be called multiple times
log.patch_logging()

is_trace = level <= log.TRACE
format_base = format_base or (
log.LOGGING_FORMAT_TRACE if is_trace else log.LOGGING_FORMAT
)
format_tid = format_tid or (
log.LOGGING_FORMAT_TRACE_TID if is_trace else log.LOGGING_FORMAT_TID
)

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

start_log() computes is_trace = level <= log.TRACE, which will raise TypeError if callers pass a string level (eg 'INFO') or another non-int level value. Since start_log() is part of the public API, consider normalizing level to an int at the start (eg via _level(level) / logging._checkLevel) before comparing and before logger.setLevel(level).

Copilot uses AI. Check for mistakes.
Comment thread src/quorum/test/log.py
import os
import logging
import tempfile
import unittest

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

unittest is imported but not used in this test module. Consider removing the unused import to keep the test file minimal (and avoid potential lint failures in environments that enforce unused-import checks).

Suggested change
import unittest

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/quorum/__init__.py (1)

127-127: Consider the public API implications of exporting _level.

The underscore prefix conventionally indicates an internal function, yet it's now part of the public exports. This is acceptable if intentional (tests use it directly as quorum._level()), but consider renaming to level if it's meant to be public API.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/quorum/__init__.py` at line 127, The module currently exports an
internal-looking symbol `_level` which makes it part of the public API despite
the underscore convention; decide whether it should be public or internal and
act accordingly: if it is intended for public use (e.g., tests call
`quorum._level()`), rename `_level` to `level` and update the export list (e.g.,
`__all__`) and all call sites/tests to use `level`; otherwise remove `_level`
from the public exports (and from `__all__`) so it remains internal and update
any external callers/tests to use the supported public API.
src/quorum/base.py (1)

686-697: Local variable is_trace shadows the module-level function.

The local variable is_trace on line 691 shadows the function is_trace() defined at line 934. While this doesn't cause a bug (the function isn't called within start_log), it's confusing and could lead to issues if the code evolves.

♻️ Suggested rename
-    is_trace = level <= log.TRACE
-    format_base = format_base or (
-        log.LOGGING_FORMAT_TRACE if is_trace else log.LOGGING_FORMAT
+    use_trace_format = level <= log.TRACE
+    format_base = format_base or (
+        log.LOGGING_FORMAT_TRACE if use_trace_format else log.LOGGING_FORMAT
     )
     format_tid = format_tid or (
-        log.LOGGING_FORMAT_TRACE_TID if is_trace else log.LOGGING_FORMAT_TID
+        log.LOGGING_FORMAT_TRACE_TID if use_trace_format else log.LOGGING_FORMAT_TID
     )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/quorum/base.py` around lines 686 - 697, The local variable is_trace in
start_log shadows the module-level is_trace() function; rename the local
variable (e.g., trace_level or is_level_trace) where it's assigned and used (the
assignment comparing level <= log.TRACE and subsequent selection of
format_base/format_tid) to avoid shadowing the is_trace() function defined
later, and update all references within start_log accordingly so the function
name remains available and the intent is clearer.
src/quorum/test/log.py (1)

177-196: Test manipulates global logging state - consider isolation.

This test removes logging._quorum_patched and logging.Logger.trace to simulate an unpatched state. While the cleanup in finally is correct, this could cause flaky behavior if tests run in parallel or if an exception occurs between deletion and the try block. The current implementation is acceptable for sequential test execution.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/quorum/test/log.py` around lines 177 - 196, The test
test_level_trace_before_patch manipulates globals logging._quorum_patched and
logging.Logger.trace which can leak state; replace the manual delete/restore
with a scoped patch so state is isolated: use unittest.mock.patch.object or
pytest's monkeypatch to temporarily remove or set logging._quorum_patched and
logging.Logger.trace around the call to quorum._level("TRACE") (e.g.,
patch.object(logging, "_quorum_patched", new=None, create=True) and
patch.object(logging.Logger, "trace", new=DEFAULT, create=True) or
monkeypatch.delattr/monkeypatch.setattr) so cleanup is automatic and no finally
block is required, keeping the assertions unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/quorum/log.py`:
- Around line 359-366: The in_signature function has two issues: it uses the
hardcoded string "secure" when checking kwargs instead of the provided name
parameter, and its parameter named callable shadows a Python builtin; fix by
renaming the parameter (e.g., to func or fn) and updating the kwargs check to
use the name variable (i.e., check if kwargs and name in kwargs). Ensure you
update all references inside in_signature (including the
inspect.getfullargspec/getargspec call) to use the new parameter name.

---

Nitpick comments:
In `@src/quorum/__init__.py`:
- Line 127: The module currently exports an internal-looking symbol `_level`
which makes it part of the public API despite the underscore convention; decide
whether it should be public or internal and act accordingly: if it is intended
for public use (e.g., tests call `quorum._level()`), rename `_level` to `level`
and update the export list (e.g., `__all__`) and all call sites/tests to use
`level`; otherwise remove `_level` from the public exports (and from `__all__`)
so it remains internal and update any external callers/tests to use the
supported public API.

In `@src/quorum/base.py`:
- Around line 686-697: The local variable is_trace in start_log shadows the
module-level is_trace() function; rename the local variable (e.g., trace_level
or is_level_trace) where it's assigned and used (the assignment comparing level
<= log.TRACE and subsequent selection of format_base/format_tid) to avoid
shadowing the is_trace() function defined later, and update all references
within start_log accordingly so the function name remains available and the
intent is clearer.

In `@src/quorum/test/log.py`:
- Around line 177-196: The test test_level_trace_before_patch manipulates
globals logging._quorum_patched and logging.Logger.trace which can leak state;
replace the manual delete/restore with a scoped patch so state is isolated: use
unittest.mock.patch.object or pytest's monkeypatch to temporarily remove or set
logging._quorum_patched and logging.Logger.trace around the call to
quorum._level("TRACE") (e.g., patch.object(logging, "_quorum_patched", new=None,
create=True) and patch.object(logging.Logger, "trace", new=DEFAULT, create=True)
or monkeypatch.delattr/monkeypatch.setattr) so cleanup is automatic and no
finally block is required, keeping the assertions unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c7344b27-aa1e-426e-b342-f7f4a64220cc

📥 Commits

Reviewing files that changed from the base of the PR and between efb794b and 66122f3.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • src/quorum/__init__.py
  • src/quorum/base.py
  • src/quorum/log.py
  • src/quorum/test/log.py

Comment thread src/quorum/log.py
Comment on lines 359 to +366
def in_signature(callable, name):
has_full = hasattr(inspect, "getfullargspec")
if has_full:
spec = inspect.getfullargspec(callable)
else:
spec = inspect.getargspec(callable)
args, _varargs, kwargs = spec[:3]
return (args and name in args) or (kwargs and "secure" in kwargs)
return bool((args and name in args) or (kwargs and "secure" in kwargs))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Bug: in_signature() kwargs check uses hardcoded "secure" instead of name parameter.

The function checks if name is in args, but the kwargs check incorrectly uses the hardcoded string "secure" instead of the name parameter. This will cause incorrect results when checking for any parameter other than "secure".

Additionally, the static analysis correctly flags that callable shadows a Python builtin.

🐛 Proposed fix
-def in_signature(callable, name):
-    has_full = hasattr(inspect, "getfullargspec")
-    if has_full:
-        spec = inspect.getfullargspec(callable)
-    else:
-        spec = inspect.getargspec(callable)
-    args, _varargs, kwargs = spec[:3]
-    return bool((args and name in args) or (kwargs and "secure" in kwargs))
+def in_signature(func, name):
+    has_full = hasattr(inspect, "getfullargspec")
+    if has_full:
+        spec = inspect.getfullargspec(func)
+    else:
+        spec = inspect.getargspec(func)
+    args, _varargs, kwargs = spec[:3]
+    return bool((args and name in args) or (kwargs and name in kwargs))
🧰 Tools
🪛 Ruff (0.15.9)

[error] 359-359: Function argument callable is shadowing a Python builtin

(A002)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/quorum/log.py` around lines 359 - 366, The in_signature function has two
issues: it uses the hardcoded string "secure" when checking kwargs instead of
the provided name parameter, and its parameter named callable shadows a Python
builtin; fix by renaming the parameter (e.g., to func or fn) and updating the
kwargs check to use the name variable (i.e., check if kwargs and name in
kwargs). Ensure you update all references inside in_signature (including the
inspect.getfullargspec/getargspec call) to use the new parameter name.

Include TRACE in the severity-ordered LEVELS tuple so that
MemoryHandler.get_messages_l() properly stores and filters TRACE
records. Add "TRAC" alias to LEVEL_ALIAS for consistent short-name
resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@joamag joamag merged commit f5a59ce into master Apr 8, 2026
33 checks passed
@joamag joamag deleted the feat/trace-log-level branch April 8, 2026 16:16
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.

2 participants