Skip to content

Commit d4af652

Browse files
olivier-stasseOlivier Stasse
authored andcommitted
[doc] Reorganize the documentation to better explain how to debug entities.
1 parent 6795ade commit d4af652

File tree

3 files changed

+16
-52
lines changed

3 files changed

+16
-52
lines changed

doc/additionalDoc/debug-doc.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
44
They are several ways to perform debugging in dynamic-graph depending on your
55
needs or situation:
6-
- Programmatically inside the entity in C++ will write inside a buffer in a
6+
- Programmatically inside the entity in C++, a logger will
7+
write inside a buffer in a
78
different thread and output in a stream (either std::cout or a file). It is
89
detailed in \subpage subp_debug_rt_logger.
9-
- Programmatically inside the entity in C++ using a member of the entities and
10-
the previous real-time mechanism. It provides 4 levels of messags :(DEBUG,INFO,
10+
It provides 4 levels of messags :(DEBUG,INFO,
1111
WARNING, ERROR). It is described in details here: \subpage subp_logger
12+
1213
- Programmatically in C++ to avoid overhead with macros and handling level as an
13-
int: \subpage subp_dbg_trace
14+
int: \subpage subp_dbg_trace .
1415
- If you just need to collect informations from signals (like rosbag). You can
1516
use an entity called Tracer inside the graph:\subpage tracerdoc . <br> A real
1617
time version exists to write directly inside a memory buffer

doc/additionalDoc/debug-logger.h

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
\page subp_logger Loggers
33
4-
\section sec_logger Initialization of the logger
4+
\section sec_init_rt_logger Initialization of the logger
55
6-
\subsection subsec_logger_hcpp Header and preprocessor variable
6+
\subsection subsec_init_rt_logger_hcpp Header and preprocessor variable
77
88
In order to activate the logger you need to add the following lines:
99
\code
@@ -22,57 +22,20 @@ It is possible to set the output stream of the messages inside a file:
2222
2323
dynamicgraph::RealTimeLogger::destroy();
2424
\endcode
25-
Here the file is "/tmp/dg-LOGS.txt".
2625
27-
\subsection subsec_logger_init Initialization of the logger
26+
\section sec_use_rt_logger Using the rt_logger
2827
29-
Inside the constructor of the entity:
30-
\code
31-
logger_.setTimeSample(0.001);
32-
logger_.setStreamPrintPeriod(0.005);
33-
logger_.setVerbosity(VERBOSITY_ALL);
34-
LoggerVerbosity alv = logger_.getVerbosity();
35-
\endcode
36-
37-
The first line sets the frequency at which the logger will be updated.<br>
38-
The second line specifies at which frequency the STREAM messages should be
39-
printed.<br>
40-
The third line specifies the level of message to accept.<br>
41-
The fourth line returns the level of verbosity.
42-
In this case, all messages are accepted and the STREAM message are displayed on
43-
the output streams once on five. <br>
44-
45-
The full list of options are:
46-
<ul>
47-
<li>VERBOSITY_ALL: Accept all messages</li>
48-
<li>VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO,
49-
WARNING, ERROR</li> <li>VERBOSITY_WARNING_ERROR: Accept messages at minimum
50-
level : WARNING, ERROR</li> <li>VERBOSITY_ERROR: Accept messages at minimum
51-
level : ERROR</li>
52-
</ul>
5328
29+
\newcode
30+
// Somewhere in your library
31+
dgRTLOG() << "your message. Prefer to use \n than std::endl."
32+
\endcode
5433
55-
\section sec_logger_tests Displaying messages
5634
57-
Here is some example on how to display or record some information.
58-
\code
59-
sendMsg("This is a message of level MSG_TYPE_DEBUG",MSG_TYPE_DEBUG,
60-
__FILE__,__LINE__); sendMsg("This is a message of level
61-
MSG_TYPE_INFO",MSG_TYPE_INFO, __FILE__,__LINE__); sendMsg("This is a message of
62-
level MSG_TYPE_WARNING",MSG_TYPE_WARNING, __FILE__,__LINE__); sendMsg("This is a
63-
message of level MSG_TYPE_ERROR",MSG_TYPE_ERROR, __FILE__,__LINE__);
64-
sendMsg("This is a message of level
65-
MSG_TYPE_DEBUG_STREAM",MSG_TYPE_DEBUG_STREAM, __FILE__,__LINE__); sendMsg("This
66-
is a message of level MSG_TYPE_INFO_STREAM",MSG_TYPE_INFO_STREAM,
67-
__FILE__,__LINE__); sendMsg("This is a message of level
68-
MSG_TYPE_WARNING_STREAM",MSG_TYPE_WARNING_STREAM, __FILE__,__LINE__);
69-
sendMsg("This is a message of level
70-
MSG_TYPE_ERROR_STREAM",MSG_TYPE_ERROR_STREAM, __FILE__,__LINE__);
35+
Here the output file is "/tmp/dg-LOGS.txt".
7136
72-
logger_.countdown();
73-
\endcode
7437
7538
Specifying the file with __FILE__ and the line inside the file by __LINE__ are
7639
necessary for the STREAM messages. Indeed they are indexed using the two values.
77-
As the default value are "" and 0 the counting will be confused.
40+
The default values "" and 0 for the counting are not well understood.
7841
*/

doc/additionalDoc/tracer-real-timedoc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ are recorded to a memory buffer, which can be emptied at any time.
1010
The \b commands that this entity exposes are:
1111
\code
1212
empty (discards all buffers)
13-
buffersize (sets buffer size for recording)
14-
trace (writes traces to files)
13+
getBufferSize (gets buffer size for recording)
14+
setBufferSize (sets buffer size for recording)
1515
\endcode
1616
Plus all the commands exposed by \ref tracerdoc
1717
\n

0 commit comments

Comments
 (0)