Skip to content

Commit

Permalink
Update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sarlinpe committed Feb 2, 2024
1 parent 9296755 commit 31d79b3
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 177 deletions.
2 changes: 1 addition & 1 deletion _pyceres/core/cost_functions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "_pyceres/helpers.h"
#include "_pyceres/log_exceptions.h"
#include "_pyceres/logging.h"

#include <ceres/ceres.h>
#include <pybind11/pybind11.h>
Expand Down
2 changes: 1 addition & 1 deletion _pyceres/core/covariance.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "_pyceres/helpers.h"
#include "_pyceres/log_exceptions.h"
#include "_pyceres/logging.h"

#include <ceres/ceres.h>
#include <pybind11/pybind11.h>
Expand Down
4 changes: 2 additions & 2 deletions _pyceres/core/loss_functions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "_pyceres/helpers.h"
#include "_pyceres/log_exceptions.h"
#include "_pyceres/logging.h"

#include <string>

Expand Down Expand Up @@ -29,7 +29,7 @@ class PyLossFunction : public ceres::LossFunction {
if (overload) {
overload.operator()(sq_norm, out_arr);
} else {
THROW_EXCEPTION(std::runtime_error, "<Evaluate> not implemented.")
LOG_FATAL_THROW(std::runtime_error) << "<Evaluate> not implemented.";
}
}

Expand Down
12 changes: 7 additions & 5 deletions _pyceres/core/manifold.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "_pyceres/helpers.h"
#include "_pyceres/log_exceptions.h"
#include "_pyceres/logging.h"

#include <ceres/ceres.h>
#include <pybind11/pybind11.h>
Expand All @@ -14,23 +14,25 @@ class PyManifold : public ceres::Manifold {
bool Plus(const double* x,
const double* delta,
double* x_plus_delta) const override {
THROW_EXCEPTION(std::runtime_error, "<Plus> not implemented.");
LOG_FATAL_THROW(std::runtime_error) << "<Plus> not implemented.";
return true;
}

bool PlusJacobian(const double* x, double* jacobian) const override {
THROW_EXCEPTION(std::runtime_error, "<PlusJacobian> not implemented.");
LOG_FATAL_THROW(std::runtime_error) << "<PlusJacobian> not implemented.";
return true;
}

bool Minus(const double* y,
const double* x,
double* y_minus_x) const override {
THROW_EXCEPTION(std::runtime_error, "<Minus> not implemented.");
LOG_FATAL_THROW(std::runtime_error) << "<Minus> not implemented.";
return true;
}

bool MinusJacobian(const double* x, double* jacobian) const override {
THROW_EXCEPTION(std::runtime_error, "<MinusJacobian> not implemented.");
LOG_FATAL_THROW(std::runtime_error) << "<MinusJacobian> not implemented.";
return true;
}

// Size of x.
Expand Down
2 changes: 1 addition & 1 deletion _pyceres/core/problem.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "_pyceres/core/wrappers.h"
#include "_pyceres/helpers.h"
#include "_pyceres/log_exceptions.h"
#include "_pyceres/logging.h"

#include <ceres/ceres.h>
#include <pybind11/pybind11.h>
Expand Down
2 changes: 1 addition & 1 deletion _pyceres/core/solver.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "_pyceres/helpers.h"
#include "_pyceres/log_exceptions.h"
#include "_pyceres/logging.h"

#include <ceres/ceres.h>
#include <pybind11/pybind11.h>
Expand Down
2 changes: 1 addition & 1 deletion _pyceres/core/types.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "_pyceres/helpers.h"
#include "_pyceres/log_exceptions.h"
#include "_pyceres/logging.h"

#include <ceres/ceres.h>
#include <ceres/normal_prior.h>
Expand Down
125 changes: 0 additions & 125 deletions _pyceres/log_exceptions.h

This file was deleted.

Loading

0 comments on commit 31d79b3

Please sign in to comment.