debug-py.cc
Go to the documentation of this file.
1 // Copyright 2019, Olivier Stasse, LAAS-CNRS.
2 //
3 // See LICENSE
4 
5 #include <iostream>
6 
7 #define ENABLE_RT_LOG
8 #include <dynamic-graph/entity.h>
9 #include <dynamic-graph/pool.h>
11 
12 #include <boost/shared_ptr.hpp>
13 #include <map>
14 #include <vector>
15 
17 
18 typedef boost::shared_ptr<std::ofstream> ofstreamShrPtr;
19 
20 namespace dynamicgraph {
21 namespace python {
22 
23 namespace debug {
24 
25 std::map<std::string, ofstreamShrPtr> mapOfFiles_;
26 
27 void addLoggerFileOutputStream(const char* filename) {
28  std::ofstream* aofs = new std::ofstream;
29  ofstreamShrPtr ofs_shrptr = boost::shared_ptr<std::ofstream>(aofs);
30  aofs->open(filename, std::ofstream::out);
33  dgRTLOG() << "Added " << filename << " as an output stream \n";
34  mapOfFiles_[filename] = ofs_shrptr;
35 }
36 
38  for (const auto& el : mapOfFiles_) el.second->close();
39 }
40 
42 
44 
46 
48 
49 } // namespace debug
50 } // namespace python
51 } // namespace dynamicgraph
#define dgADD_OSTREAM_TO_RTLOG(ostr)
void addLoggerFileOutputStream(const char *filename)
Definition: debug-py.cc:27
std::map< std::string, ofstreamShrPtr > mapOfFiles_
Definition: debug-py.cc:25
boost::shared_ptr< std::ofstream > ofstreamShrPtr
Definition: debug-py.cc:18
#define dgRTLOG()
static RealTimeLogger & instance()


dynamic-graph-python
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Sun Jun 25 2023 02:55:50