♻ ️ replace the hard-coded logger instances with "switcher" key
Summary
Switcher is a library and there is no way a singleton logger will be introduced, because this will after the possibility to instantiate comprehensively two Switcher instances from the same process.
All logger instances defined with spdlog::get("switcher")
instead of using the unique switcher_->logger
should be replaced.
How to reproduce ?
Search for
spdlog::get("switcher")
in code base, you'll find 14 similar approaches used to fetch logger.
Version used to reproduce issue
- switcher: develop@d4204842 (Oct 17, 2022 11:31am GMT-0400)
Expected behavior
No singleton should be used here.
What is the frequency of occurrence of this behavior ?
100%
Other comment
The following discussion from !494 (merged) should be addressed:
-
@nicobou started a discussion: (+5 comments) With hard-coded
switcher
, a singleton is introduced. You must use the switcher logger.logger_(switcher_->logger) {
You can also avoid storing the logger into the session class and use the
switcher_
logger each time with thisswitcher_->logger
.