Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Copyright 2005, 2006, 2007, 2008, 2009, 2010,
*
* Olivier Stasse
*
* JRL, CNRS/AIST
*
* This file is part of walkGenJrl.
* walkGenJrl is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* walkGenJrl is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
*
* Research carried out within the scope of the
* Joint Japanese-French Robotics Laboratory (JRL)
*/
/* @doc File for debugging messages. */
#include <iostream>
#include <fstream>
#include <exception>
#define LTHROW(x) \
{ \
class Exception: public std::exception \
{ \
virtual const char * what() const throw() \
{ \
return x; \
} \
}; \
\
Exception almsg; \
throw almsg; }
#define ODEBUG2(x)
#define ODEBUG3(x) std::cerr << __FILE__ << ":" \
<< __FUNCTION__ << "(#" \
<< __LINE__ << "):" << x << std::endl;
#define RESETDEBUG5(y) { std::ofstream DebugFile; \
DebugFile.open(y,ofstream::out); \
DebugFile.close();}
#define ODEBUG5(x,y) { std::ofstream DebugFile; \
DebugFile.open(y,ofstream::app); \
DebugFile << __FILE__ << ":" \
<< __FUNCTION__ << "(#" \
<< __LINE__ << "):" << x << std::endl; \
DebugFile.close();}
#define ODEBUG5SIMPLE(x,y) { std::ofstream DebugFile; \
DebugFile.open(y,ofstream::app); \
DebugFile << x << std::endl; \
DebugFile.close();}
#define ODEBUG3_NENDL(x) std::cerr << x
#ifdef _DEBUG_MODE_ON_
#define ODEBUG(x) std::cerr << __FILE__ << ":" \
<< __FUNCTION__ << "(#" \
<< __LINE__ << "):" << x << std::endl;
#define ODEBUG_NENDL(x) std::cerr << x
#define ODEBUG_CODE(x) x
#else
#define ODEBUG(x)
#define ODEBUG_NENDL(x)
#define ODEBUG_CODE(x)
#endif
#ifdef _DEBUG_MODE_ON_
#define RESETDEBUG4(y) { std::ofstream DebugFile; DebugFile.open(y,ofstream::out); DebugFile.close();}
#define ODEBUG4(x,y) { std::ofstream DebugFile; DebugFile.open(y,ofstream::app); \
DebugFile << __FILE__ << ":" \
<< __FUNCTION__ << "(#" \
<< __LINE__ << "):" << x << std::endl; \
DebugFile.close();}
#define ODEBUG4SIMPLE(x,y) { std::ofstream DebugFile; \
DebugFile.open(y,ofstream::app); \
DebugFile << x << std::endl; \
DebugFile.close();}
#define _DEBUG_4_ACTIVATED_ 1
#else
#define RESETDEBUG4(y)
#define ODEBUG4(x,y)
#define ODEBUG4SIMPLE(x,y)
#endif
#define RESETDEBUG6(x)
#define ODEBUG6(x,y)