mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
Notify on product conversion start as in 0.7
This commit is contained in:
@@ -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<IfcGeom::BRepElement*>(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);
|
||||
|
||||
@@ -62,7 +62,7 @@ template <>
|
||||
const std::array<std::basic_string<wchar_t>, 5> severity_strings<wchar_t>::value = {L"Performance", L"Debug", L"Notice", L"Warning", L"Error"};
|
||||
|
||||
template <typename T>
|
||||
void plain_text_message(T& os, const boost::optional<IfcUtil::IfcBaseClass*>& current_product, Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) {
|
||||
void plain_text_message(T& os, const boost::optional<const IfcUtil::IfcBaseClass*>& current_product, Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) {
|
||||
os << "[" << severity_strings<typename T::char_type>::value[type] << "] ";
|
||||
os << "[" << get_time(type <= Logger::LOG_PERF).c_str() << "] ";
|
||||
if (current_product) {
|
||||
@@ -87,7 +87,7 @@ std::basic_string<T> string_as(const std::string& s) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void json_message(T& os, const boost::optional<IfcUtil::IfcBaseClass*>& current_product, Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) {
|
||||
void json_message(T& os, const boost::optional<const IfcUtil::IfcBaseClass*>& current_product, Logger::Severity type, const std::string& message, const IfcUtil::IfcBaseInterface* instance) {
|
||||
boost::property_tree::basic_ptree<std::basic_string<typename T::char_type>, std::basic_string<typename T::char_type>> pt;
|
||||
|
||||
// @todo this is crazy
|
||||
@@ -112,7 +112,7 @@ void json_message(T& os, const boost::optional<IfcUtil::IfcBaseClass*>& current_
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void Logger::SetProduct(boost::optional<IfcUtil::IfcBaseClass*> product) {
|
||||
void Logger::SetProduct(boost::optional<const IfcUtil::IfcBaseClass*> 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<IfcUtil::IfcBaseClass*> Logger::current_product;
|
||||
boost::optional<const IfcUtil::IfcBaseClass*> Logger::current_product;
|
||||
boost::optional<long long> Logger::first_timepoint;
|
||||
std::map<std::string, double> Logger::performance_statistics;
|
||||
std::map<std::string, double> Logger::performance_signal_start;
|
||||
|
||||
@@ -60,7 +60,7 @@ class IFC_PARSE_API Logger {
|
||||
|
||||
static Severity verbosity;
|
||||
static Format format;
|
||||
static boost::optional<IfcUtil::IfcBaseClass*> current_product;
|
||||
static boost::optional<const IfcUtil::IfcBaseClass*> current_product;
|
||||
static Severity max_severity;
|
||||
|
||||
static boost::optional<long long> first_timepoint;
|
||||
@@ -70,7 +70,7 @@ class IFC_PARSE_API Logger {
|
||||
static bool print_perf_stats_on_element;
|
||||
|
||||
public:
|
||||
static void SetProduct(boost::optional<IfcUtil::IfcBaseClass*> product);
|
||||
static void SetProduct(boost::optional<const IfcUtil::IfcBaseClass*> product);
|
||||
|
||||
/// Determines to what stream respectively progress and errors are logged
|
||||
static void SetOutput(std::wostream* l1, std::wostream* l2);
|
||||
|
||||
Reference in New Issue
Block a user