Skip to content

Commit

Permalink
README improve links and fix TOC
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmoon79 committed Jan 11, 2023
1 parent 679fc8d commit 5e897fc
Showing 1 changed file with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# si_trace_print<!-- omit in TOC -->
# si_trace_print<!-- omit in toc -->

***s***tack ***i***ndented ***trace*** ***print***ing;
a simple rust library to print messages indented to stack depth optionally preceded by the function name.

Useful for trace printing function flows in a simple manual approach.
An "entry-level" tracing library that prints function flows in a simple manual
approach.

[![Build status](https://img.shields.io/github/actions/workflow/status/jtmoon79/si_trace_print/rust.yml?branch=main&style=flat-square&logo=github)](https://github.com/jtmoon79/si_trace_print/actions?query=workflow%3Arust)
[![docs.rs](https://img.shields.io/docsrs/si_trace_print/latest?badge.svg&style=flat-square&logo=docsdotrs)](https://docs.rs/si_trace_print/latest/)
Expand All @@ -15,17 +16,16 @@ Useful for trace printing function flows in a simple manual approach.
---

<!-- TOC generated by Markdown All In One -->
- [si\_trace\_print](#si_trace_print)
- [About](#about)
- [Use](#use)
- [Trace-printing example](#trace-printing-example)
- [Manually setting the indentation](#manually-setting-the-indentation)
- [Shortcomings](#shortcomings)
- [Slow](#slow)
- [Release builds](#release-builds)
- [Code Clutter](#code-clutter)
- [Hogs *stdout* Or *stderr*](#hogs-stdout-or-stderr)
- [Other tracing crates](#other-tracing-crates)
- [About](#about)
- [Use](#use)
- [Trace-printing example](#trace-printing-example)
- [Manually setting the indentation](#manually-setting-the-indentation)
- [Shortcomings](#shortcomings)
- [Slow](#slow)
- [Release builds](#release-builds)
- [Code Clutter](#code-clutter)
- [Hogs *stdout* Or *stderr*](#hogs-stdout-or-stderr)
- [Other tracing crates](#other-tracing-crates)

---

Expand Down Expand Up @@ -279,7 +279,7 @@ profiles, some functions may be optimized inline.
The count of stack frames may not change among function calls.
This means the printed indentation will not reflect function call depth.
This can be forcibly avoided by adding attribute `#[inline(never)]` to such
functions.
functions, though even that is not guaranteed to work.

### Code Clutter

Expand All @@ -289,22 +289,29 @@ too messy.
### Hogs *stdout* Or *stderr*

If your rust code requires sending messages on both stdout and stderr then
`si_trace_print` will interfere with it's own messages.
`si_trace_print` will interfere.

## Other tracing crates

Here are some other tracing crates with different features.

- [`trace`](https://crates.io/crates/trace) a procedural macro that acts like
function wrapper.
- [`tracing`](https://crates.io/crates/tracing) a heavy-dute framework for
in-depth program analysis
- [`rftrace`](https://crates.io/crates/rftrace) uses compiler-provided function
tracing. The crates page it's own section _Alternative Tracers_.
- [`trace`] a procedural macro that acts like function wrapper.
- [`tracing`] a heavy-dute framework for in-depth program analysis
- [`rftrace`] uses compiler-provided function tracing via compiler feature
`mcount`.
The crates page has it's own section *Alternative Tracers*.
- [`uftrace`] originally a C/C++ tracer that now supports rust. Requires
specific installed libraries and compiler configuration.
- [`gsingh93/trace`] a macro-based trace library, similar to `si_trace_print`

<!-- links -->

[`backtrace::trace`]: https://docs.rs/backtrace/0.3.66/backtrace/fn.trace.html
[`trace`]: https://crates.io/crates/trace
[`tracing`]: https://crates.io/crates/tracing
[`rftrace`]: https://crates.io/crates/rftrace
[`uftrace`]: https://github.com/namhyung/uftrace/
[`gsingh93/trace`]: https://github.com/gsingh93/trace

---

Expand Down

0 comments on commit 5e897fc

Please sign in to comment.