Added tracing-subscriber crate to have one common way of logging with the Rust driver, as the Rust driver uses tracing crate for logging and cpp-rust driver should allow clients to configure logging by specifying the max log level and providing callback that should be called on each event.
Solution:
As logging should be configured globally, the current implementation creates a custom tracing subscriber with default configuration, which later can be changed by the user. The global and mutable state of the logging configuration is initialized in the lazy_static! block, however, it will be evaluated only after the first access in the code. As, the cass_session_new() function most probably is the first function that the user will call (almost all tests do that, too), the initialization of logging is chosen to be done in this function.
The CassLogMessage has a field function that should always be empty, as it cannot be properly set, because event metadata does not include information about it.
Enabled LoggingTests tests in github actions.
Pre-review checklist
[x] I have split my patch into logically separate commits.
[x] All commit messages clearly explain what they change and why.
[x] PR description sums up the changes and reasons why they should be introduced.
[x] I have enabled appropriate tests in .github/workflows/build.yaml in gtest_filter.
Motivation:
Added
tracing-subscriber
crate to have one common way of logging with the Rust driver, as the Rust driver usestracing
crate for logging and cpp-rust driver should allow clients to configure logging by specifying the max log level and providing callback that should be called on each event.Solution:
As logging should be configured globally, the current implementation creates a custom tracing subscriber with default configuration, which later can be changed by the user. The global and mutable state of the logging configuration is initialized in the
lazy_static!
block, however, it will be evaluated only after the first access in the code. As, thecass_session_new()
function most probably is the first function that the user will call (almost all tests do that, too), the initialization of logging is chosen to be done in this function.The CassLogMessage has a field
function
that should always be empty, as it cannot be properly set, because event metadata does not include information about it.Enabled
LoggingTests
tests in github actions.Pre-review checklist
.github/workflows/build.yaml
ingtest_filter
.