scylladb / cpp-rust-driver

API-compatible rewrite of https://github.com/scylladb/cpp-driver as a wrapper for Rust driver.
GNU Lesser General Public License v2.1
11 stars 11 forks source link

Logging: allow setting log level more than once #115

Open Gor027 opened 1 year ago

Gor027 commented 1 year ago

After #111 was merged, setting the logging level by calling cass_log_set_level implied that a global tracing subscriber is set for the duration of the entire program. As the default global subscriber can be set only once, later attempts to set the logging level are ignored. Although the logging configuration should not be changed after a session is established, this limitation is too restrictive, so perhaps it is possible to avoid it by setting a default subscriber for each thread before they start an execution: https://docs.rs/tokio/latest/tokio/runtime/struct.Builder.html#method.on_thread_start