Skip to content

Commit f035dd7

Browse files
authoredJan 14, 2025
Merge pull request #248 from inviwo/feature/logging
Misc,TensorVis,VectorVis: core logging changes
2 parents 0816787 + 89340c9 commit f035dd7

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed
 

‎misc/devtools/include/inviwo/devtools/processors/eventlogger.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ void EventLogger<Inport, Outport>::invokeEvent(Event* event) {
157157
const auto it = eventMap_.find(event->hash());
158158
if ((it == eventMap_.end() && enableOtherEvents_.get()) ||
159159
(it != eventMap_.end() && it->second.get())) {
160-
LogProcessorInfo(std::setw(15) << getDisplayName() << " " << *event);
160+
std::ostringstream oss;
161+
event->print(oss);
162+
log::info("Processor {:>15}: {}", getDisplayName(), oss.str());
161163
}
162164
}
163165

‎misc/openmesh/src/utils/openmeshconverters.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ void createVertexBuffers(TriMesh& mesh, const Mesh& inmesh, TransformCoordinates
120120
return vec3(tmp) / tmp.w;
121121
});
122122
} else {
123-
throw inviwo::Exception("Unknown position buffer type",
124-
IvwContextCustom("openmeshutil::meshHelper"));
123+
throw inviwo::Exception("Unknown position buffer type");
125124
}
126125
}
127126
}
@@ -135,8 +134,7 @@ void createVertexBuffers(TriMesh& mesh, const Mesh& inmesh, TransformCoordinates
135134
mesh.set_normal(VH(i++), {n.x, n.y, n.z});
136135
}
137136
} else {
138-
throw inviwo::Exception("Unknown normals buffer type",
139-
IvwContextCustom("openmeshutil::meshHelper"));
137+
throw inviwo::Exception("Unknown normals buffer type");
140138
}
141139
} else if (buf.first.type == BufferType::ColorAttrib) {
142140
auto loop = [&](auto& buf, auto toVec4) {
@@ -156,8 +154,7 @@ void createVertexBuffers(TriMesh& mesh, const Mesh& inmesh, TransformCoordinates
156154
} else if (auto u3 = std::dynamic_pointer_cast<const Buffer<glm::u8vec3>>(buf.second)) {
157155
loop(u3, [](glm::u8vec3 v) { return vec4(v, 255.0f) / 255.0f; });
158156
} else {
159-
throw inviwo::Exception("Unknown normals buffer type",
160-
IvwContextCustom("openmeshutil::meshHelper"));
157+
throw inviwo::Exception("Unknown normals buffer type");
161158
}
162159
} else if (buf.first.type == BufferType::TexCoordAttrib) {
163160
if (auto t1 = std::dynamic_pointer_cast<const Buffer<float>>(buf.second)) {
@@ -181,8 +178,7 @@ void createVertexBuffers(TriMesh& mesh, const Mesh& inmesh, TransformCoordinates
181178
mesh.set_texcoord3D(VH(i++), {v.x, v.y, v.z});
182179
}
183180
} else {
184-
throw inviwo::Exception("Unknown normals buffer type",
185-
IvwContextCustom("openmeshutil::meshHelper"));
181+
throw inviwo::Exception("Unknown normals buffer type");
186182
}
187183
}
188184
}

‎tensorvis/tensorvisbase/src/processors/invariantspacefilter.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,9 @@ void InvariantSpaceFilter::process() {
8686
}
8787
}
8888

89-
LogProcessorInfo(
90-
std::to_string((float(numberOfFilteredTensors) / float(numberOfElements)) * 100.f)
91-
<< "% filtered (" << std::to_string(numberOfFilteredTensors) << " out of "
92-
<< std::to_string(numberOfElements) << ").");
89+
log::info("{}% filtered ({} out of {})",
90+
(float(numberOfFilteredTensors) / float(numberOfElements)) * 100.f,
91+
numberOfFilteredTensors, numberOfElements);
9392

9493
invariantSpaceOutport_.setData(filteredInvariantSpace);
9594
}

‎vectorvis/integrallinefiltering/src/processors/integrallinestodataframe.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ IntegralLinesToDataFrame::MetaDataSettings* IntegralLinesToDataFrame::geMetaData
361361
if (auto mdp = dynamic_cast<MetaDataSettings*>(p)) {
362362
return mdp;
363363
}
364-
throw inviwo::Exception("Not a MetaDataSettings", IvwContext);
364+
throw inviwo::Exception("Not a MetaDataSettings");
365365
}
366366
auto newProp = std::make_unique<MetaDataSettings>(id, key);
367367
auto newPropPtr = newProp.get();

0 commit comments

Comments
 (0)