Skip to content

Commit

Permalink
Drop using __PRETTY_FUNCTION__
Browse files Browse the repository at this point in the history
  • Loading branch information
RainerKuemmerle committed Dec 2, 2023
1 parent 4305283 commit 6a15a35
Show file tree
Hide file tree
Showing 34 changed files with 108 additions and 186 deletions.
4 changes: 2 additions & 2 deletions g2o/apps/g2o_cli/g2o.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <algorithm>
#include <cassert>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
Expand All @@ -50,6 +49,7 @@
#include "g2o/stuff/color_macros.h"
#include "g2o/stuff/command_args.h"
#include "g2o/stuff/filesys_tools.h"
#include "g2o/stuff/logger.h"
#include "g2o/stuff/macros.h"
#include "g2o/stuff/string_tools.h"
#include "g2o/stuff/timeutil.h"
Expand Down Expand Up @@ -91,7 +91,7 @@ void sigquit_handler(int sig) {
hasToStop = 1;
static int cnt = 0;
if (cnt++ == 2) {
cerr << __PRETTY_FUNCTION__ << " forcing exit" << endl;
G2O_WARN("forcing exit");
exit(1);
}
}
Expand Down
9 changes: 3 additions & 6 deletions g2o/apps/g2o_cli/output_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@

#include <Eigen/Core>
#include <fstream>
#include <iostream>

#include "g2o/core/hyper_graph_action.h"
#include "g2o/core/optimizable_graph.h"
#include "g2o/stuff/filesys_tools.h"
#include "g2o/stuff/string_tools.h"
#include "g2o/stuff/logger.h"
using namespace std;

namespace g2o {
Expand Down Expand Up @@ -65,8 +64,7 @@ bool saveGnuplot(const std::string& gnudump,
HyperGraphElementAction* saveGnuplot =
HyperGraphActionLibrary::instance()->actionByName("writeGnuplot");
if (!saveGnuplot) {
cerr << __PRETTY_FUNCTION__ << ": no action \"writeGnuplot\" registered"
<< endl;
G2O_ERROR("no action \"writeGnuplot\" registered");
return false;
}
WriteGnuplotAction::Parameters params;
Expand Down Expand Up @@ -187,8 +185,7 @@ bool dumpEdges(std::ostream& os, const OptimizableGraph& optimizer) {
HyperGraphElementAction* saveGnuplot =
HyperGraphActionLibrary::instance()->actionByName("writeGnuplot");
if (!saveGnuplot) {
cerr << __PRETTY_FUNCTION__ << ": no action \"writeGnuplot\" registered"
<< endl;
G2O_ERROR("no action \"writeGnuplot\" registered");
return false;
}
WriteGnuplotAction::Parameters params;
Expand Down
3 changes: 2 additions & 1 deletion g2o/apps/g2o_simulator/sensor_odometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#ifndef G2O_ODOMETRY_SENSOR_
#define G2O_ODOMETRY_SENSOR_

#include "g2o/stuff/logger.h"
#include "simulator.h"
namespace g2o {

Expand All @@ -53,7 +54,7 @@ class SensorOdometry : public BinarySensor<R, E, O> {
++it;
}
if (!(pcurr && pprev)) {
cerr << __PRETTY_FUNCTION__ << ": fatal, trajectory empty" << endl;
G2O_ERROR("fatal, trajectory empty");
return;
}
_robotPoseObject = pprev;
Expand Down
5 changes: 2 additions & 3 deletions g2o/apps/g2o_simulator/sensor_odometry2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

#include "sensor_odometry2d.h"

#include <cassert>
#include <iostream>
#include "g2o/stuff/logger.h"

// Robot2D
namespace g2o {
Expand All @@ -53,7 +52,7 @@ void SensorOdometry2D::sense() {
++it;
}
if (!(pcurr && pprev)) {
cerr << __PRETTY_FUNCTION__ << ": fatal, trajectory empty" << endl;
G2O_ERROR("fatal, trajectory empty");
return;
}
_robotPoseObject = pprev;
Expand Down
3 changes: 2 additions & 1 deletion g2o/apps/g2o_simulator/sensor_odometry3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "sensor_odometry3d.h"

#include "g2o/stuff/logger.h"
#include "g2o/types/slam3d/isometry3d_mappings.h"

namespace g2o {
Expand Down Expand Up @@ -65,7 +66,7 @@ void SensorOdometry3D::sense() {
++it;
}
if (!(pcurr && pprev)) {
cerr << __PRETTY_FUNCTION__ << ": fatal, trajectory empty" << endl;
G2O_ERROR("fatal, trajectory empty");
return;
}
_robotPoseObject = pprev;
Expand Down
2 changes: 1 addition & 1 deletion g2o/apps/g2o_viewer/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void MainWindow::on_btnInitialGuess_clicked() {
}
break;
default:
cerr << __PRETTY_FUNCTION__ << " Unknown initialization method" << endl;
cerr << " Unknown initialization method" << endl;
break;
}

Expand Down
2 changes: 1 addition & 1 deletion g2o/core/block_solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ bool BlockSolver<Traits>::updateStructure(
PoseMatrixType* m = _Hpp->block(ind1, ind2, true);
e->mapHessianMemory(m->data(), viIdx, vjIdx, transposedBlock);
} else {
G2O_ERROR("{}: not supported", __PRETTY_FUNCTION__);
G2O_ERROR("not supported");
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions g2o/core/cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

#include "cache.h"

#include <iostream>

#include "factory.h"
#include "g2o/stuff/logger.h"
#include "optimizable_graph.h"
Expand Down Expand Up @@ -119,13 +117,11 @@ Cache* CacheContainer::createCache(const Cache::CacheKey& key) {
Factory* f = Factory::instance();
HyperGraph::HyperGraphElement* e = f->construct(key.type());
if (!e) {
G2O_ERROR("{}", __PRETTY_FUNCTION__);
G2O_ERROR("fatal error in creating cache of type {}", key.type());
return nullptr;
}
Cache* c = dynamic_cast<Cache*>(e);
if (!c) {
G2O_ERROR("{}", __PRETTY_FUNCTION__);
G2O_ERROR("fatal error in creating cache of type {}, wrong type",
key.type());
return nullptr;
Expand Down
9 changes: 2 additions & 7 deletions g2o/core/hyper_dijkstra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@

#include <cassert>
#include <deque>
#include <iostream>
#include <queue>
#include <vector>

#include "g2o/stuff/logger.h"
#include "g2o/stuff/macros.h"

namespace g2o {

Expand Down Expand Up @@ -100,8 +97,7 @@ void HyperDijkstra::shortestPaths(HyperGraph::VertexSet& vset,
assert(v != 0);
AdjacencyMap::iterator it = _adjacencyMap.find(v);
if (it == _adjacencyMap.end()) {
G2O_WARN("{} Vertex {} is not in the adjacency map", __PRETTY_FUNCTION__,
v->id());
G2O_WARN("Vertex {} is not in the adjacency map", v->id());
}
assert(it != _adjacencyMap.end());
it->second._distance = 0.;
Expand All @@ -115,8 +111,7 @@ void HyperDijkstra::shortestPaths(HyperGraph::VertexSet& vset,
HyperGraph::Vertex* u = entry.child();
AdjacencyMap::iterator ut = _adjacencyMap.find(u);
if (ut == _adjacencyMap.end()) {
G2O_WARN("{} Vertex {} is not in the adjacency map", __PRETTY_FUNCTION__,
u->id());
G2O_WARN("Vertex {} is not in the adjacency map", u->id());
}
assert(ut != _adjacencyMap.end());
double uDistance = ut->second.distance();
Expand Down
17 changes: 6 additions & 11 deletions g2o/core/hyper_graph_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@

#include "hyper_graph_action.h"

#include <iostream>
#include <list>

#include "cache.h"
#include "g2o/stuff/logger.h"
#include "g2o/stuff/macros.h"
#include "optimizable_graph.h"

namespace g2o {
Expand Down Expand Up @@ -99,14 +97,13 @@ HyperGraphElementAction* HyperGraphElementActionCollection::operator()(
bool HyperGraphElementActionCollection::registerAction(
const HyperGraphElementAction::HyperGraphElementActionPtr& action) {
#ifdef G2O_DEBUG_ACTIONLIB
G2O_DEBUG("{} {} {}", __PRETTY_FUNCTION__, action->name(),
action->typeName());
G2O_DEBUG("{} {}", action->name(), action->typeName());
#endif
if (action->name() != name()) {
G2O_ERROR(
"{}: invalid attempt to register an action in a collection with a "
"invalid attempt to register an action in a collection with a "
"different name {} {}",
__PRETTY_FUNCTION__, name(), action->name());
name(), action->name());
}
_actionMap.insert(make_pair(action->typeName(), action));
return true;
Expand Down Expand Up @@ -152,18 +149,16 @@ bool HyperGraphActionLibrary::registerAction(
collection = dynamic_cast<HyperGraphElementActionCollection*>(oldAction);
if (!collection) {
G2O_ERROR(
"{}: : fatal error, a collection is not at the first level in the "
"library",
__PRETTY_FUNCTION__);
"fatal error, a collection is not at the first level in the "
"library");
return false;
}
}
if (collection) {
return collection->registerAction(action);
}
#ifdef G2O_DEBUG_ACTIONLIB
G2O_DEBUG("{}: creating collection for {}", __PRETTY_FUNCTION__,
action->name());
G2O_DEBUG("creating collection for {}", action->name());
#endif
collection = new HyperGraphElementActionCollection(action->name());
_actionMap.insert(make_pair(
Expand Down
Loading

0 comments on commit 6a15a35

Please sign in to comment.