Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph
Commits
d4af652a
Commit
d4af652a
authored
May 21, 2020
by
Olivier Stasse
Committed by
olivier stasse
May 25, 2020
Browse files
[doc] Reorganize the documentation to better explain how to debug entities.
parent
6795adee
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/additionalDoc/debug-doc.h
View file @
d4af652a
...
...
@@ -3,14 +3,15 @@
They are several ways to perform debugging in dynamic-graph depending on your
needs or situation:
- Programmatically inside the entity in C++ will write inside a buffer in a
- Programmatically inside the entity in C++, a logger will
write inside a buffer in a
different thread and output in a stream (either std::cout or a file). It is
detailed in \subpage subp_debug_rt_logger.
- Programmatically inside the entity in C++ using a member of the entities and
the previous real-time mechanism. It provides 4 levels of messags :(DEBUG,INFO,
It provides 4 levels of messags :(DEBUG,INFO,
WARNING, ERROR). It is described in details here: \subpage subp_logger
- Programmatically in C++ to avoid overhead with macros and handling level as an
int: \subpage subp_dbg_trace
int: \subpage subp_dbg_trace
.
- If you just need to collect informations from signals (like rosbag). You can
use an entity called Tracer inside the graph:\subpage tracerdoc . <br> A real
time version exists to write directly inside a memory buffer
...
...
doc/additionalDoc/debug-logger.h
View file @
d4af652a
/**
\page subp_logger Loggers
\section sec_logger Initialization of the logger
\section sec_
init_rt_
logger Initialization of the logger
\subsection subsec_logger_hcpp Header and preprocessor variable
\subsection subsec_
init_rt_
logger_hcpp Header and preprocessor variable
In order to activate the logger you need to add the following lines:
\code
...
...
@@ -22,57 +22,20 @@ It is possible to set the output stream of the messages inside a file:
dynamicgraph::RealTimeLogger::destroy();
\endcode
Here the file is "/tmp/dg-LOGS.txt".
\
sub
section s
ubsec_logger_init Initialization of
the logger
\section s
ec_use_rt_logger Using
the
rt_
logger
Inside the constructor of the entity:
\code
logger_.setTimeSample(0.001);
logger_.setStreamPrintPeriod(0.005);
logger_.setVerbosity(VERBOSITY_ALL);
LoggerVerbosity alv = logger_.getVerbosity();
\endcode
The first line sets the frequency at which the logger will be updated.<br>
The second line specifies at which frequency the STREAM messages should be
printed.<br>
The third line specifies the level of message to accept.<br>
The fourth line returns the level of verbosity.
In this case, all messages are accepted and the STREAM message are displayed on
the output streams once on five. <br>
The full list of options are:
<ul>
<li>VERBOSITY_ALL: Accept all messages</li>
<li>VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO,
WARNING, ERROR</li> <li>VERBOSITY_WARNING_ERROR: Accept messages at minimum
level : WARNING, ERROR</li> <li>VERBOSITY_ERROR: Accept messages at minimum
level : ERROR</li>
</ul>
\newcode
// Somewhere in your library
dgRTLOG() << "your message. Prefer to use \n than std::endl."
\endcode
\section sec_logger_tests Displaying messages
Here is some example on how to display or record some information.
\code
sendMsg("This is a message of level MSG_TYPE_DEBUG",MSG_TYPE_DEBUG,
__FILE__,__LINE__); sendMsg("This is a message of level
MSG_TYPE_INFO",MSG_TYPE_INFO, __FILE__,__LINE__); sendMsg("This is a message of
level MSG_TYPE_WARNING",MSG_TYPE_WARNING, __FILE__,__LINE__); sendMsg("This is a
message of level MSG_TYPE_ERROR",MSG_TYPE_ERROR, __FILE__,__LINE__);
sendMsg("This is a message of level
MSG_TYPE_DEBUG_STREAM",MSG_TYPE_DEBUG_STREAM, __FILE__,__LINE__); sendMsg("This
is a message of level MSG_TYPE_INFO_STREAM",MSG_TYPE_INFO_STREAM,
__FILE__,__LINE__); sendMsg("This is a message of level
MSG_TYPE_WARNING_STREAM",MSG_TYPE_WARNING_STREAM, __FILE__,__LINE__);
sendMsg("This is a message of level
MSG_TYPE_ERROR_STREAM",MSG_TYPE_ERROR_STREAM, __FILE__,__LINE__);
Here the output file is "/tmp/dg-LOGS.txt".
logger_.countdown();
\endcode
Specifying the file with __FILE__ and the line inside the file by __LINE__ are
necessary for the STREAM messages. Indeed they are indexed using the two values.
As t
he default value
are
"" and 0 the counting
will be confuse
d.
T
he default value
s
"" and 0
for
the counting
are not well understoo
d.
*/
doc/additionalDoc/tracer-real-timedoc.h
View file @
d4af652a
...
...
@@ -10,8 +10,8 @@ are recorded to a memory buffer, which can be emptied at any time.
The \b commands that this entity exposes are:
\code
empty (discards all buffers)
b
uffer
s
ize (
s
ets buffer size for recording)
trace (writes traces to files
)
getB
uffer
S
ize (
g
ets buffer size for recording)
setBufferSize (sets buffer size for recording
)
\endcode
Plus all the commands exposed by \ref tracerdoc
\n
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment