Based on a previous post, I implemented the example to read all the lines from the console.
"This example accesses the default logger and gets all displayed lines".
I changed the microsdk example to implement the function.
Below the Execute() part of the command plugin.
However, it does not show any lines in the console.
Also, when I change DiagnosticOutput("Line: @", line._str);
to ApplicationOutput("Line: @", line._str);
cinema 'hangs' on the line above userLoggerType.Iterate([](maxon::LoggerLine& line) -> maxon::Result<void>
Could it be that I did not activate the diagnostic output?
Manual: "The output is visible in debug builds or in a release build when the debug console with diagnostic output is activated"
virtual Bool Execute(BaseDocument* doc)
{
iferr_scope_handler
{
// if an error occurred, show a pop-up message
const maxon::String errString = err.ToString(nullptr);
::MessageDialog(errString);
return false;
};
//###########################################
// This example accesses the default logger and gets all displayed lines.
// get default logger
ApplicationOutput("This example accesses the default logger and gets all displayed lines.");
const maxon::LoggerRef defaultLogger = maxon::Loggers::Default();
for (const auto& logger : defaultLogger.GetLoggerTypes())
{
const maxon::LoggerTypeRef loggerType = logger.GetFirst(); // get first element of the pair
if (loggerType.IsInstanceOf<maxon::UserLoggerTypeRef>())
{
const maxon::UserLoggerTypeRef userLoggerType = maxon::Cast<maxon::UserLoggerTypeRef>(loggerType);
// iterate over all lines sent to the logger
userLoggerType.Iterate([](maxon::LoggerLine& line) -> maxon::Result<void>
{
DiagnosticOutput("Line: @", line._str);
//ApplicationOutput("Line: @", line._str);
return maxon::OK;
}) iferr_return;
}
}
return true;
}