Skip to content

Expose loggers logic#3132

Open
ognyanstoimenov wants to merge 1 commit into
masterfrom
logger_refactor
Open

Expose loggers logic#3132
ognyanstoimenov wants to merge 1 commit into
masterfrom
logger_refactor

Conversation

@ognyanstoimenov
Copy link
Copy Markdown
Collaborator

@ognyanstoimenov ognyanstoimenov commented May 22, 2026

Reference Issues/PRs

  • Moves register_log from python_bindings to python_bindings_common so it is reusable
  • Makes the log python method accept an extension so it is reusable

Used in https://github.com/man-group/arcticdb-enterprise/pull/329

What does this implement or fix?

Any other comments?

Checklist

Checklist for code changes...
  • Have you updated the relevant docstrings, documentation and copyright notice?
  • Is this contribution tested against all ArcticDB's features?
  • Do all exceptions introduced raise appropriate error messages?
  • Are API changes highlighted in the PR description?
  • Is the PR labelled as enhancement or bug so it appears in autogenerated release notes?

.export_values();
}

void register_log(py::module&& log, arcticdb::BindingScope scope) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copy-pasted from cpp/arcticdb/python/python_module.cpp. Only changed to accept BindingScope and made the exposed methods not take choose_logger by ref as it goes out of scope. Which I am not sure how it worked OK before

@ognyanstoimenov ognyanstoimenov added patch Small change, should increase patch version no-release-notes This PR shouldn't be added to release notes. labels May 22, 2026
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 22, 2026

ArcticDB Code Review Summary

PR Title & Description

  • Description is empty — only the template is present. Explain what changed (move register_log out of python_module.cpp into python_bindings_common.cpp; expose a reusable build_loggers(ext_log) factory in python/arcticdb/log.py; thread BindingScope into the enum registrations) and why (presumably so another extension module can register the same logger bindings against its own ext.log submodule — please confirm).
  • Title is vague — "Expose loggers logic" doesn't name the component or the concrete change. Something like "Refactor logger bindings into a reusable factory" would be clearer.

Notes (no action required)

  • Public API of arcticdb.log is preserved: configure, logger_by_name, and the per-name module globals (root, storage, version, ...) still resolve for existing call-sites in config.py, _store.py, flattener.py, etc.
  • Labels (patch, no-release-notes) are appropriate for an internal-only refactor.
  • The switch from [&] to [choose_logger] (by-value) capture in the inner log/is_active lambdas implicitly fixes a latent dangling-reference issue — the previous [&] stored a reference to a local lambda inside pybind11's persistent closure, which was UB once register_log returned. Worth mentioning in the description as a side benefit.

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

Labels

no-release-notes This PR shouldn't be added to release notes. patch Small change, should increase patch version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant