Commit e4d3adf6 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by olivier stasse

Provide backward compatibility + reorganize headers.

parent f17106c5
......@@ -45,14 +45,18 @@ enum MsgType {
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#include <map>
/// \todo These 3 headers should be removed.
#include <fstream>
#include <iomanip> // std::setprecision
#include <sstream>
#include <boost/assign.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <dynamic-graph/deprecated.hh>
#include <dynamic-graph/linear-algebra.h>
#include <dynamic-graph/real-time-logger-def.h>
#include <fstream>
#include <iomanip> // std::setprecision
#include <map>
#include <sstream>
namespace dynamicgraph {
......@@ -217,6 +221,14 @@ public:
*/
void sendMsg(std::string msg, MsgType type, const std::string& lineId = "");
/** \deprecated instead, use
* \code
* stream(type, lineId) << msg << '\n';
* \endcode
*/
void sendMsg(std::string msg, MsgType type, const std::string& file,
int line) DYNAMIC_GRAPH_DEPRECATED;
/** Set the sampling time at which the method countdown()
* is going to be called. */
bool setTimeSample(double t);
......
......@@ -43,6 +43,13 @@ void Logger::sendMsg(std::string msg, MsgType type, const std::string &lineId) {
stream(type, lineId) << msg << '\n';
}
void Logger::sendMsg(std::string msg, MsgType type, const std::string &file,
int line) {
std::ostringstream oss;
oss << file << line;
stream(type, oss.str()) << msg << '\n';
}
bool Logger::setTimeSample(double t) {
if (t <= 0.0)
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment