@@ -156,10 +156,7 @@ boost::shared_ptr<AggregationScenarioData> OREApp::getMarketCube(std::string cub
156156}
157157
158158std::vector<std::string> OREApp::getErrors () {
159- std::vector<std::string> errors;
160- while (fbLogger_ && fbLogger_->logger ->hasNext ())
161- errors.push_back (fbLogger_->logger ->next ());
162- return errors;
159+ return structuredLogger_->messages ();
163160}
164161
165162Real OREApp::getRunTime () {
@@ -383,6 +380,7 @@ void OREApp::run() {
383380 runTimer_.start ();
384381
385382 try {
383+ structuredLogger_->clear ();
386384 analytics ();
387385 } catch (std::exception& e) {
388386 StructuredAnalyticsWarningMessage (" OREApp::run()" , " Error" , e.what ()).log ();
@@ -403,6 +401,7 @@ void OREApp::run(const std::vector<std::string>& marketData,
403401
404402 try {
405403 LOG (" ORE analytics starting" );
404+ structuredLogger_->clear ();
406405 MEM_LOG_USING_LEVEL (ORE_WARNING)
407406
408407 QL_REQUIRE (inputs_, " ORE input parameters not set" );
@@ -1411,8 +1410,6 @@ void OREApp::setupLog(const std::string& path, const std::string& file, Size mas
14111410 QL_REQUIRE (boost::filesystem::is_directory (p), " output path '" << path << " ' is not a directory." );
14121411
14131412 Log::instance ().registerLogger (boost::make_shared<FileLogger>(file));
1414- // Report StructuredErrorMessages with level WARNING, ERROR, CRITICAL, ALERT
1415- fbLogger_ = boost::make_shared<FilteredBufferedLoggerGuard>();
14161413 boost::filesystem::path oreRootPath =
14171414 logRootPath.empty () ? boost::filesystem::path (__FILE__).parent_path ().parent_path ().parent_path ().parent_path ()
14181415 : logRootPath;
@@ -1428,10 +1425,10 @@ void OREApp::setupLog(const std::string& path, const std::string& file, Size mas
14281425 Log::instance ().registerIndependentLogger (progressLogger);
14291426
14301427 // Structured message logger
1431- auto structuredLogger = boost::make_shared<StructuredLogger>();
1428+ structuredLogger_ = boost::make_shared<StructuredLogger>();
14321429 string structuredLogFilePath = structuredLogFile.empty () ? path + " /log_structured.json" : structuredLogFile;
1433- structuredLogger ->setFileLog (structuredLogFilePath, path, structuredLogRotationSize);
1434- Log::instance ().registerIndependentLogger (structuredLogger );
1430+ structuredLogger_ ->setFileLog (structuredLogFilePath, path, structuredLogRotationSize);
1431+ Log::instance ().registerIndependentLogger (structuredLogger_ );
14351432
14361433 // Event message logger
14371434 auto eventLogger = boost::make_shared<EventLogger>();
0 commit comments