User:MarcusMueller/Message Debug: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(Copy of original page)
 
(Proposed overhaul of wiki page)
Line 1: Line 1:
[[Category:Block Docs]]
[[Category:Block Docs]]
Debug block for the message passing system.
Debug block for the message passing system.


The message debug block is used to capture and print or store messages as they are received. Any block that generates a message may connect that message port to one or more of the three message input ports of this debug block.
The message debug block is used to capture and print or store messages as they are received. Any block that generates a message may connect that message port to one or more of the message input ports of this debug block.


The message ports are:
The message ports are, if not showing the extended logging levels


* print: prints the message directly to standard out.
; log
* store: stores the message in an internal vector. It works in conjunction with a message_debug::get_message(size_t i) call that allows us to retrieve message i afterward.
: Uses the GNU Radio logging system to print the message contents. '''This is probably the input you want.'''
* print_pdu: specifically designed to handle formatted PDUs (see pdu.h). It discards messages that aren't PDU pairs (or are null).
; print
: Prints the message directly to standard out; verbose, not logged to any configured logging backends. You can suppress the printing of PDU data blob contents with the "Print PDU contents" option.
; store
: Stores the message in an internal vector. It works in conjunction with a <code>message_debug::get_message(size_t i)</code> call that allows us to retrieve message <code>i</code> afterwards.


== Parameters ==
== Parameters ==


None
; Print PDU contents
: Prints a hexdump of the contents of PDUs; if not set, only print the meta description and length
; Log level
: sets the log level to trace, debug, info, warning, error or critical
 


== Example Flowgraph ==
== Example Flowgraph ==
In this example, a Message Strobe block sends the string "Demo" once per second. It is displayed on the user terminal by the Message Debug block.


[[File:PUB_SUB_msg_demo.png]]
[[File:Message_debug.png]]
 


== Source Files ==
== Source Files ==


; C++ files
; C++ files
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/lib/message_debug_impl.cc]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/message_debug_impl.cc]


; Header files
; Header files
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/lib/message_debug_impl.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/lib/message_debug_impl.h]


; Public header files
; Public header files
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/include/gnuradio/blocks/message_debug.h]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/include/gnuradio/blocks/message_debug.h]


; Block definition
; Block definition
: [https://github.com/gnuradio/gnuradio/blob/master/gr-blocks/grc/blocks_message_debug.block.yml]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/grc/blocks_message_debug.block.yml]
 
; Example flowgraphs
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/examples/message_debug.grc]
: [https://github.com/gnuradio/gnuradio/blob/main/gr-blocks/examples/probe_rate_message_debug.grc]

Revision as of 12:33, 7 July 2022


Debug block for the message passing system.

The message debug block is used to capture and print or store messages as they are received. Any block that generates a message may connect that message port to one or more of the message input ports of this debug block.

The message ports are, if not showing the extended logging levels

log
Uses the GNU Radio logging system to print the message contents. This is probably the input you want.
print
Prints the message directly to standard out; verbose, not logged to any configured logging backends. You can suppress the printing of PDU data blob contents with the "Print PDU contents" option.
store
Stores the message in an internal vector. It works in conjunction with a message_debug::get_message(size_t i) call that allows us to retrieve message i afterwards.

Parameters

Print PDU contents
Prints a hexdump of the contents of PDUs; if not set, only print the meta description and length
Log level
sets the log level to trace, debug, info, warning, error or critical


Example Flowgraph

Message debug.png


Source Files

C++ files
[1]
Header files
[2]
Public header files
[3]
Block definition
[4]
Example flowgraphs
[5]
[6]