Refactor and rename ConsoleObserver...

...Renamed to "ILogger", to designate that this is an Interface for a
Logger. This "Interface" is pure virtual, so that it cannot be
instantiated directly. This makes it clear that it is intended to be
derived.

Finally, got rid of all the individual log-style methods and replaced
with SendLog. The idea here is that day-to-day users will only interact
with ILogger through ConsoleSingleton (or, likely, LoggerSingleton in
the future). This singleton will manage an arbirtary collection of
ILogger, and call SendLog with the appropriate parameters based on what
the user requests.

Therefore, the singleton itself will have the individual Log, Message,
Error, etc... methods, while stil allowing us to simplify the code base
of ILogger and its derived classes.
This commit is contained in:
ezzieyguywuf
2019-09-10 00:27:36 -04:00
committed by wmayer
parent 7416055dbb
commit 9fcc18b08e
12 changed files with 392 additions and 417 deletions

View File

@@ -300,13 +300,15 @@ void Builder3D::addTransformation(const Base::Vector3f& translation, const Base:
*/
void Builder3D::saveToLog(void)
{
result << "} ";
// Note: The string can become very long, so that ConsoleSingelton::Log() will internally
// truncate the string which causes Inventor to fail to interpret the truncated string.
// So, we send the string directly to the observer that handles the Inventor stuff.
//Console().Log("Vdbg: %s \n",result.str().c_str());
ConsoleObserver* obs = Base::Console().Get("StatusBar");
if (obs) obs->Log(result.str().c_str());
result << "} ";
// Note: The string can become very long, so that ConsoleSingelton::Log() will internally
// truncate the string which causes Inventor to fail to interpret the truncated string.
// So, we send the string directly to the observer that handles the Inventor stuff.
//Console().Log("Vdbg: %s \n",result.str().c_str());
ILogger* obs = Base::Console().Get("StatusBar");
if (obs != nullptr){
obs->SendLog(result.str().c_str(), Base::LogStyle::Log);
}
}
/**