diff --git a/src/ifcopenshell-python/ifcopenshell/__init__.py b/src/ifcopenshell-python/ifcopenshell/__init__.py index 0141a43359..a16a20e100 100644 --- a/src/ifcopenshell-python/ifcopenshell/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/__init__.py @@ -70,3 +70,4 @@ def create_entity(type,*args,**kwargs): version = ifcopenshell_wrapper.version() schema_identifier = ifcopenshell_wrapper.schema_identifier() get_supertype = ifcopenshell_wrapper.get_supertype +get_log = ifcopenshell_wrapper.get_log diff --git a/src/ifcwrap/IfcParseWrapper.i b/src/ifcwrap/IfcParseWrapper.i index ec8b3f4722..b554b67e56 100644 --- a/src/ifcwrap/IfcParseWrapper.i +++ b/src/ifcwrap/IfcParseWrapper.i @@ -445,4 +445,18 @@ private: IfcSchema::Type::PopulateDerivedFields(data); return IfcSchema::SchemaEntity(data); } +%} + +%{ + static std::stringstream ifcopenshell_log_stream; +%} +%init %{ + Logger::SetOutput(0, &ifcopenshell_log_stream); +%} +%inline %{ + std::string get_log() { + std::string log = ifcopenshell_log_stream.str(); + ifcopenshell_log_stream.str(""); + return log; + } %} \ No newline at end of file