rdbg
Quick and dirty Rust remote debugging. This crate is more or less equivalent to dbg and println in the stdlib but delivers the payloads via a TCP socket to a remote viewer.
Use Cases
In many cases, for quick debugging the dbg and println macros will often suffice. However, there are three main use cases where this crate comes in handy:
- Tests - while it is possible to output from tests it can be tricky to do so at times
- Programs with no stdout available (example: Windows services, etc.)
- Programs with lots of output, where it is difficult to disambiguate debug output from other output
In all cases, this crate does not replace a regular debugger. If you wish/need to use a full-fledged debugger by all means do so.
Features
- No dependencies
- Enabled and added in seconds
- Familiar API
- Can be quickly be removed or compiled into "no-op"
Example
let world = "world!";
// More or less equivalent to `println`
msg!;
// More or less equivalent to `dbg`
vals!;
That works fine for servers and long-running programs, but since the messages are delivered
via a different thread there is an implicit race condition. As such, if your program
is not a server or long-running you will likely need the wait_and_quit function at
the end of your program. This will pause execution until all messages have been sent
via the TCP socket.
let world = "world!";
// More or less equivalent to `println`
msg!;
// More or less equivalent to `dbg`
vals!;
// Wait for messages to be transmitted before exiting
quit_and_wait;
Usage
[]
= "0.1"
Features
enabled(default) - enables debugginginsecure-remote- Listens on 0.0.0.0 for remote debugging purposes (insecure, no auth)
Use --no-default-features option to quickly turn this crate into a no-op. Please note
that due to feature unification other uses of this crate within the same project could
turn it back on.