Skip to content

Commit

Permalink
Implemented support for logging to TCP endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
orium committed Nov 5, 2022
1 parent 5415fe2 commit 1f2974f
Show file tree
Hide file tree
Showing 2 changed files with 201 additions and 39 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

<!-- cargo-rdme start -->

`dirty-debug` offers a quick and easy way to log message to a file for debugging.
`dirty-debug` offers a quick and easy way to log message to a file (or tcp endpoint) for
temporary debugging.

A simple but powerful way to debug a program is to printing some messages to understand your
code’s behavior. However, sometimes you don’t have access to the `stdout`/`stderr` streams (for
Expand All @@ -28,4 +29,19 @@ message to that file, together with the filename and line number of the source c
Note that this is not meant to be a normal form of logging: `dirty-debug` should only be used
temporarily during your debug session and discarded after that.

## Logging to a TCP endpoint

You can also use `dirty-debug` to log to a TCP endpoint instead of a file:

```rust
ddbg!("tcp://192.168.1.42:12345", "Hello!");
```

Probably the easiest way to listen to a TCP endpoint in the target computer is by using netcat:

```console
$ ncat -l 12345
[src/lib.rs:123] Hello!
```

<!-- cargo-rdme end -->
Loading

0 comments on commit 1f2974f

Please sign in to comment.