
Am 11.03.2013 10:13, schrieb Andrey Semashev:
What I find a little strange interface-wise is logging::core::get()->set_filter(...)
The core is a singleton, yes. The pointer is returned to allow to lock the core from destruction on program termination. The core won't be destroyed while there still are loggers.
then it's an implemention detail, I'd suggest making all the functions of logging::core static, or make logging::core a namespace. if you wanna add the feature you've mentioned later on, you could for example ask the user to construct and hold a core::log_during_termination object, which - again as an implementation detail - holds a shared_ptr to the internal core.
Not that the library works ok on program termination, but the existing problems are not related to the premature core destruction, and this pointer technique lays the foundation for further improvements in this area.