Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

17
rdbg: Quick and Dirty Rust Debugging
Post Body

I needed some quick and dirty println and dbg debugging in a program where I didn't have access to stdout/stderr, so I wrote these crates that allow you to do the equivalent over a TCP socket to a remote viewer. The remote viewer is a simple CLI program but it is based on a simple to use iterator crate making the creation of alternate versions pretty simple.

The main crate has no dependencies and uses a short crate name making it very quick and easy to add/remove on the fly. If you do wish to keep it in your source after debugging just turn off default options and it will compile into a no-op. By default, it works on localhost but you can add remote debugging via a remote-insecure feature (there is no auth).

There are three crates currently: * rdbg - Used by the debugged program * rdbg-view - A very basic command line viewer * rdbg-client - A crate that makes it very easy to write your own viewer

Example

let world = "world!";
// More or less equivalent to `println`
rdbg::msg!("Hello {}", world);

// More or less equivalent to `dbg`
rdbg::vals!(world, 1   5);

Example output (from rdbg-view)

*** Trying to connect to 127.0.0.1:13579... ***
*** Connected to 127.0.0.1:13579 ***
T:1670688040648 THR:1 rdbg/examples/hello_world.rs:4 hello world
T:1670688040648 THR:1 rdbg/examples/hello_world.rs:5 |world->"world"| |1   5->6|
*** Disconnected from 127.0.0.1:13579 ***

Author
Account Strength
90%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
2,263
Link Karma
352
Comment Karma
1,891
Profile updated: 16 hours ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago