Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic-graph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
dynamic-graph
Commits
d4af652a
Commit
d4af652a
authored
4 years ago
by
Olivier Stasse
Committed by
olivier stasse
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[doc] Reorganize the documentation to better explain how to debug entities.
parent
6795adee
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/additionalDoc/debug-doc.h
+5
-4
5 additions, 4 deletions
doc/additionalDoc/debug-doc.h
doc/additionalDoc/debug-logger.h
+9
-46
9 additions, 46 deletions
doc/additionalDoc/debug-logger.h
doc/additionalDoc/tracer-real-timedoc.h
+2
-2
2 additions, 2 deletions
doc/additionalDoc/tracer-real-timedoc.h
with
16 additions
and
52 deletions
doc/additionalDoc/debug-doc.h
+
5
−
4
View file @
d4af652a
...
@@ -3,14 +3,15 @@
...
@@ -3,14 +3,15 @@
They are several ways to perform debugging in dynamic-graph depending on your
They are several ways to perform debugging in dynamic-graph depending on your
needs or situation:
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
different thread and output in a stream (either std::cout or a file). It is
detailed in \subpage subp_debug_rt_logger.
detailed in \subpage subp_debug_rt_logger.
- Programmatically inside the entity in C++ using a member of the entities and
It provides 4 levels of messags :(DEBUG,INFO,
the previous real-time mechanism. It provides 4 levels of messags :(DEBUG,INFO,
WARNING, ERROR). It is described in details here: \subpage subp_logger
WARNING, ERROR). It is described in details here: \subpage subp_logger
- Programmatically in C++ to avoid overhead with macros and handling level as an
- 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
- 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
use an entity called Tracer inside the graph:\subpage tracerdoc . <br> A real
time version exists to write directly inside a memory buffer
time version exists to write directly inside a memory buffer
...
...
This diff is collapsed.
Click to expand it.
doc/additionalDoc/debug-logger.h
+
9
−
46
View file @
d4af652a
/**
/**
\page subp_logger Loggers
\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:
In order to activate the logger you need to add the following lines:
\code
\code
...
@@ -22,57 +22,20 @@ It is possible to set the output stream of the messages inside a file:
...
@@ -22,57 +22,20 @@ It is possible to set the output stream of the messages inside a file:
dynamicgraph::RealTimeLogger::destroy();
dynamicgraph::RealTimeLogger::destroy();
\endcode
\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.
Here the output file is "/tmp/dg-LOGS.txt".
\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__);
logger_.countdown();
\endcode
Specifying the file with __FILE__ and the line inside the file by __LINE__ are
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.
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.
*/
*/
This diff is collapsed.
Click to expand it.
doc/additionalDoc/tracer-real-timedoc.h
+
2
−
2
View file @
d4af652a
...
@@ -10,8 +10,8 @@ are recorded to a memory buffer, which can be emptied at any time.
...
@@ -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:
The \b commands that this entity exposes are:
\code
\code
empty (discards all buffers)
empty (discards all buffers)
b
uffer
s
ize (
s
ets buffer size for recording)
getB
uffer
S
ize (
g
ets buffer size for recording)
trace (writes traces to files
)
setBufferSize (sets buffer size for recording
)
\endcode
\endcode
Plus all the commands exposed by \ref tracerdoc
Plus all the commands exposed by \ref tracerdoc
\n
\n
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment