[log] calling init_from_stream() or init_from_settings() more than once (reinitialize at runtime)
Hello, I've just started experimenting with the unofficial Boost.Log by Andrey Semashev. I would like to know the defined behaviour of calling init_from_stream() and init_from_settings() more than once, i.e. is it possible to re-initialize with new settings at run time? Basically I would like to do this: boost::log::settings setts; setts["Sink:File"]["Filter"] = "%Severity% > 4"; setts["Sink:File"]["Destination"] = "TextFile"; setts["Sink:File"]["FileName"] = "MyApp_%3N.log"; setts["Sink:File"]["AutoFlush"] = true; setts["Sink:File"]["RotationSize"] = 10 * 1024 * 1024; // 10 MiB boost::log::init_from_settings(setts); // ... later on change severity filter to >= 0 setts["Sink:File"]["Filter"] = "%Severity% >= 0"; boost::log::init_from_settings(setts); This does not work. It seems I am able to add new sinks without problem, but modifying existing sinks is not possible. I think that being able to reinitialize at runtime is an absolutely vital feature. Being able to change a settings file and then just reinit to turn on logging! Please tell me this is already supported and I am doing something wrong, or at least that this will be supported in the future :) Regards, Oskar
participants (1)
-
Oskar Nordquist