mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Add CBasicLogConfigurator::deconfigure method to clear the global log targets
This commit is contained in:
parent
fca9bcdd7f
commit
0fe71b7c44
@ -140,3 +140,10 @@ EConsoleTextColor::EConsoleTextColor CBasicLogConfigurator::getConsoleColor(cons
|
|||||||
else
|
else
|
||||||
throw std::runtime_error("Color " + colorName + " unknown.");
|
throw std::runtime_error("Color " + colorName + " unknown.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CBasicLogConfigurator::deconfigure() {
|
||||||
|
auto l = CLogger::getGlobalLogger();
|
||||||
|
if(l != nullptr) {
|
||||||
|
l->clearTargets();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -29,6 +29,10 @@ public:
|
|||||||
|
|
||||||
/// Configures a default logging system by adding the console target and the file target to the global logger.
|
/// Configures a default logging system by adding the console target and the file target to the global logger.
|
||||||
void configureDefault();
|
void configureDefault();
|
||||||
|
|
||||||
|
/// Removes all targets from the global logger.
|
||||||
|
void deconfigure();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Gets ELogLevel enum from string. (Should be moved to CLogger as a separate function?)
|
// Gets ELogLevel enum from string. (Should be moved to CLogger as a separate function?)
|
||||||
// Throws: std::runtime_error
|
// Throws: std::runtime_error
|
||||||
|
Loading…
Reference in New Issue
Block a user