diff --git a/src/ifcgeom/Iterator.h b/src/ifcgeom/Iterator.h index abeb98d24d..cb4cf92389 100644 --- a/src/ifcgeom/Iterator.h +++ b/src/ifcgeom/Iterator.h @@ -469,6 +469,8 @@ namespace IfcGeom { auto product_node = rep->products.front(); const IfcUtil::IfcBaseEntity* product = product_node.first; const auto& place = product_node.second; + + Logger::SetProduct(product); IfcGeom::BRepElement* brep = static_cast(decorate_with_cache_(GeometrySerializer::READ_BREP, (std::string)*product->get("GlobalId"), std::to_string(representation->instance->data().id()), [kernel, settings, product, place, representation]() { return kernel->create_brep_for_representation_and_product(representation, product, place); diff --git a/src/ifcparse/IfcLogger.cpp b/src/ifcparse/IfcLogger.cpp index 5a8acc2567..03fde3dde2 100644 --- a/src/ifcparse/IfcLogger.cpp +++ b/src/ifcparse/IfcLogger.cpp @@ -62,7 +62,7 @@ template <> const std::array, 5> severity_strings::value = {L"Performance", L"Debug", L"Notice", L"Warning", L"Error"}; template -void plain_text_message(T& os, const boost::optional& current_product, Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) { +void plain_text_message(T& os, const boost::optional& current_product, Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) { os << "[" << severity_strings::value[type] << "] "; os << "[" << get_time(type <= Logger::LOG_PERF).c_str() << "] "; if (current_product) { @@ -87,7 +87,7 @@ std::basic_string string_as(const std::string& s) { } template -void json_message(T& os, const boost::optional& current_product, Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) { +void json_message(T& os, const boost::optional& current_product, Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) { boost::property_tree::basic_ptree, std::basic_string> pt; // @todo this is crazy @@ -112,7 +112,7 @@ void json_message(T& os, const boost::optional& current_ } } // namespace -void Logger::SetProduct(boost::optional product) { +void Logger::SetProduct(boost::optional product) { if (verbosity <= LOG_DEBUG && product) { Message(LOG_DEBUG, "Begin processing", *product); } @@ -246,7 +246,7 @@ std::stringstream Logger::log_stream; Logger::Severity Logger::verbosity = Logger::LOG_NOTICE; Logger::Severity Logger::max_severity = Logger::LOG_NOTICE; Logger::Format Logger::format = Logger::FMT_PLAIN; -boost::optional Logger::current_product; +boost::optional Logger::current_product; boost::optional Logger::first_timepoint; std::map Logger::performance_statistics; std::map Logger::performance_signal_start; diff --git a/src/ifcparse/IfcLogger.h b/src/ifcparse/IfcLogger.h index 0534813254..f7f0dec73b 100644 --- a/src/ifcparse/IfcLogger.h +++ b/src/ifcparse/IfcLogger.h @@ -60,7 +60,7 @@ class IFC_PARSE_API Logger { static Severity verbosity; static Format format; - static boost::optional current_product; + static boost::optional current_product; static Severity max_severity; static boost::optional first_timepoint; @@ -70,7 +70,7 @@ class IFC_PARSE_API Logger { static bool print_perf_stats_on_element; public: - static void SetProduct(boost::optional product); + static void SetProduct(boost::optional product); /// Determines to what stream respectively progress and errors are logged static void SetOutput(std::wostream* l1, std::wostream* l2);