Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracing: add record! macro #2926

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 3, 2024

  1. tracing: add record! macro

    Add a macro that provides a more consise way of recording a new value
    for a field.
    
    Example usage:
    
    ```rust
    fn my_function() {
        let my_new_value = my_other_function();
    
        // Using the current API:
        tracing::Span::current().record("example", tracing::field::debug(my_new_value));
    
        // Using this proposal:
        tracing::record!("example", ?my_new_value);
    }
    ```
    marcusirgens committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    d6fb4a9 View commit details
    Browse the repository at this point in the history