-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tracing subscriber to enable logging
Motivation: 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.
- Loading branch information
Showing
12 changed files
with
359 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#![allow(non_camel_case_types)] | ||
|
||
include!(concat!(env!("OUT_DIR"), "/cppdriver_log.rs")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.