Am 04.11.2014 um 13:46 schrieb Andreas Welchlin:
> Hi List,
>
> I would like to set the loglevel of my applications on the fly.
>
> So my application would start with a configured loglevel of "INFO".
>
> After some hours I would send a command to the application to set the
> loglevel to "DEBUG" and some minutes afterwards I would
> set it back to "INFO".
>
> Is this possible with cxxtools?
>
> I found cxxtools::Configuration::setLogLevel. But to me it seems like I
> would have to call log_init, afterwards. Would this work?
>
> Andreas
It does not work with cxxtools 2.1 but works with HEAD. You can call
log_init whenever and how often you want to reinitialize logging. Best
way to go is to fetch the configuration using
cxxtools::LogManager::getInstance::getLogConfiguration(), change the
configuration and call log_init with that again like that:
cxxtools::LogConfiguration logConfiguration =
cxxtools::LogManager::getInstance::getLogConfiguration();
logConfiguration.setRootLevel(cxxtools::Logger::DEBUG);
logConfiguration.setLogLevel("myapp.mycategory", cxxtools::Logger::INFO);
log_init(logConfiguration);
When I see that, it looks too complicated. I guess I should look, how to
make it easier.
Tommi
------------------------------------------------------------------------------
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general