-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: API, Implementation
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Currently, mongocxx::instance configures logging on construction. That means that logging can only be safely configured once per application.
There may be cases where turning logging on only temporarily is desirable (e.g. to debug certain sections of code). By binding logging to the lifetime of libmongoc initialization/cleanup, we prevent users from modifying the global logging callback.
We should split logging out of mongocxx::instance and use that only for libmongoc initialization/cleanup. Setting the global logger should be a method on that class.
We could also allow someone to get a copy of the current global logging function and use a guard object to temporarily replace it for a particular scope.
- related to
-
CXX-3324 Deprecate mongocxx::v_noabi::instance::current()
-
- Closed
-