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

subscriber: if error occurs when formatting event, write error to Writer #2102

Merged

Commits on Apr 29, 2022

  1. subscriber: if error occurs when formatting event, print to stderr

    When `Format_event::format_event(...)` returns an error, we are
    currently silently dropping that
    Event. tokio-rs/valuable#88 explains one
    such case in which this was encountered (due to a bug in
    valuable-serde). We want to be made aware whenever an Event is dropped.
    
    This patch adds a single `eprintln` line to let the user know that we
    were unable to format a specific event. We are not emitting an actual
    tracing Event, to avoid the risk of a cycle (the new Event could
    trigger the same formatting error again).
    
    Resolves tokio-rs#1965.
    bryangarza committed Apr 29, 2022
    Copy the full SHA
    c725c8a View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2022

  1. subscriber: write format_event errors to Writer, update SubscriberBui…

    …lder
    
    Update the error-handling logic when calling `format_event` to write
    the error message to the Writer. Only if that fails do we write to
    stderr.
    
    Define new method `SubscriberBuilder::with_silence_errors(bool)` so
    that a user may disable this behavior. Enabled by default.
    
    Add unit tests for both `silence_errors=true` and `false`.
    bryangarza committed Apr 30, 2022
    Copy the full SHA
    aa64320 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2022

  1. Copy the full SHA
    e8b3563 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2022

  1. Copy the full SHA
    a36c569 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'feat-1965-stderr-for-subscriber-fmt-errors' of github.c…

    …om:bryangarza/tracing into feat-1965-stderr-for-subscriber-fmt-errors
    bryangarza committed May 18, 2022
    Copy the full SHA
    7d233dc View commit details
    Browse the repository at this point in the history

Commits on May 25, 2022

  1. Copy the full SHA
    38bb7af View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2022

  1. Improve wording for with_silence_errors

    Co-authored-by: David Barsky <me@davidbarsky.com>
    bryangarza and davidbarsky committed Jul 8, 2022
    Copy the full SHA
    d341dba View commit details
    Browse the repository at this point in the history
  2. Update stderr messages to show origin is tracing_subscriber

    Co-authored-by: Eliza Weisman <eliza@buoyant.io>
    bryangarza and hawkw committed Jul 8, 2022
    Copy the full SHA
    ac14307 View commit details
    Browse the repository at this point in the history
  3. subscriber: update format_error_print_to_stderr unit test for OS-agno…

    …stic assertions
    
    Co-authored-by: Eliza Weisman <eliza@buoyant.io>
    bryangarza and hawkw committed Jul 8, 2022
    Copy the full SHA
    e081ec8 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    23ab2c5 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    868245a View commit details
    Browse the repository at this point in the history
  6. subscriber: rename with_silence_errors to be more clear

    This patch updates `with_silence_errors` to be named
    `with_silence_internal_errors`, and also updates the rustdocs so that
    it's more clear what its behavior is.
    bryangarza committed Jul 8, 2022
    Copy the full SHA
    ccbfa94 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2022

  1. subscriber: rename with_silence_internal_errors flag

    This patch renames the `with_silence_internal_errors` flag to simply
    `log_internal_errors`, and switches the default value to `true` since
    the flag now represents the opposite idea.
    bryangarza committed Jul 13, 2022
    Copy the full SHA
    699a0b8 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2022

  1. Copy the full SHA
    0b045f6 View commit details
    Browse the repository at this point in the history