EmbarkStudios / EmbarkStudios/puffin

Log text via puffin

Open
#171 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
1.7k
Forks
111
Avg merge
2h 50m
Merged PRs (30d)
1

Description

I sometimes get `.puffin` files from users and wished it contained more information. One of the major questions I often have is "was this recorded on a debug build?".

A great solution for this would be to add support for logging text in puffin. `puffin` could by default log `cfg!(debug_assertions)` and rust compiler version, for instance, and puffin users could log their application version, build flags, etc.

The viewer should show these log messages in its own window.

Implementation-wise, I think it makes sense to log these as _events_, which like _scopes_ contains file:line and function name and a start_time, but no end-time, because it is an instantaneous thing.

In the future we could also support showing such events in the flamegraph, so that one can log custom strings that give more context for a function call for instance, similar to the current "dynamic data".

## Example

```rust
puffin::log!("Debug build: {}", cfg!(debug_assertions));
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.