Skip to content

refactor(logging): consolidate LOG_* macros with variadic dispatch#296

Merged
kcenon merged 1 commit into
mainfrom
refactor/issue-294-consolidate-log-macros
Jan 20, 2026
Merged

refactor(logging): consolidate LOG_* macros with variadic dispatch#296
kcenon merged 1 commit into
mainfrom
refactor/issue-294-consolidate-log-macros

Conversation

@kcenon

@kcenon kcenon commented Jan 20, 2026

Copy link
Copy Markdown
Owner

Closes #294

Summary

  • Introduce unified variadic LOG_* macros that accept both 1-arg and 2-arg forms using argument counting dispatch
  • Mark LOG_*_TO macros as deprecated while maintaining full backward compatibility
  • Add helper macros (KCENON_LOG_ARG_COUNT, KCENON_LOG_DISPATCH) for clean variadic implementation

Test Plan

  • All 111 existing tests pass
  • Build succeeds in Release configuration
  • Verify backward compatibility: existing LOG_DEBUG(msg) calls work unchanged
  • Verify new usage: LOG_DEBUG(logger_name, msg) works as expected

Introduce unified variadic LOG_* macros that accept both 1-arg (default
logger) and 2-arg (named logger) forms, eliminating the need for separate
_TO suffix macros.

- Add KCENON_LOG_ARG_COUNT and KCENON_LOG_DISPATCH helper macros for
  argument counting and dispatch
- Unify LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR,
  LOG_CRITICAL to support variadic usage
- Mark LOG_*_TO macros as deprecated (kept for backward compatibility)
- Update compile-time level filtering to use variadic no-op definitions

Closes #294
@kcenon kcenon merged commit 49e4a81 into main Jan 20, 2026
24 checks passed
@kcenon kcenon deleted the refactor/issue-294-consolidate-log-macros branch January 20, 2026 12:17
kcenon added a commit that referenced this pull request Apr 13, 2026
)

Introduce unified variadic LOG_* macros that accept both 1-arg (default
logger) and 2-arg (named logger) forms, eliminating the need for separate
_TO suffix macros.

- Add KCENON_LOG_ARG_COUNT and KCENON_LOG_DISPATCH helper macros for
  argument counting and dispatch
- Unify LOG_TRACE, LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR,
  LOG_CRITICAL to support variadic usage
- Mark LOG_*_TO macros as deprecated (kept for backward compatibility)
- Update compile-time level filtering to use variadic no-op definitions

Closes #294
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.

refactor: Consolidate LOG_DEBUG macro definitions to eliminate duplication

1 participant