get_log in python

This commit is contained in:
Thomas Krijnen
2017-08-19 16:54:06 +02:00
parent 490c35bf60
commit 7bea054c1e
2 changed files with 15 additions and 0 deletions
@@ -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
+14
View File
@@ -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;
}
%}