aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-error/src/tracing.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-151-3/+0
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* arti: set_protocol_warning_mode to Warn or Off in setup_loggingmoumenalaoui2026-04-081-9/+20
|
* tor-error: add runtime ProtocolWarningMode and promote TorProtocolViolation ↵moumenalaoui2026-03-271-1/+182
| | | | in event_report!
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* tor-error: allow only error given to `_report!` macrosSteven Engler2025-08-181-0/+25
| | | | | | | | | | This is useful when you create an `internal!` error and then immediately report it. If the `_report!` macro also requires a message, then you need to provide two messages for the error, which doesn't always make sense. This is already possible anyways with `warn_report!(e,)`. Now you don't need the comma.
* tor-error: update `_report!` macros to support tracing fieldsSteven Engler2025-08-181-38/+15
| | | | | | | | | | This requires that we put the error in a field. There are two issues that we'll fix in the next two commits: 1. Errors are no longer formatted with `ErrorReport`. 2. Errors will be in the first field, but long (or multiline) error messages will cause other fields to be pushed to the end where they're harder to find.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* tor-error: tests: Demonstrate warn_report on bare error and anyhowIan Jackson2023-12-121-0/+35
|
* tor-error: fmt_ending_ok: Permit messages ending in ascii ellipsisIan Jackson2023-11-201-0/+1
| | | | | | | | | Tbis will result in "some message ...: the error" which I think is OK. We don't use a Unicode single-character ellipsis because that character can be hard to read at font sizes which are otherwise OK for text, and because use of non-ascii in logfiles and error messages is unecessary and might cause unnecessary trouble (for example, if the log messages end up going somewhere which isn't 100% valid UTF-8).
* tor-error: fmt_ending_ok: Implement with a direct matchIan Jackson2023-11-201-1/+5
| | | | | Possibly at some point in the past, matching a slice directly wasn't possible. But it is now.
* Fix warn_report and error_report macros.Nick Mathewson2023-07-071-4/+10
| | | | | | | | | Originally they didn't check err.kind(), since err.kind() can never increase their severity. We lost that behavior with !1386, and we became dependent on it with arti!1383. Since they both merged at the same time, CI broke. This patch restores their original behavior.
* tor-error: tracing module: Use macro to generate macrosIan Jackson2023-07-071-91/+53
| | | | | | | | | | This abolishes some quintuplication. The output is identical except that: * The syntax display in the rustdoc output for the resulting macros seems to have somewhat less whitepsace. * The whimsical error messages in the examples are all identical. Ah well.
* tor-error: tracing module: Fix link to tracing macroIan Jackson2023-07-071-1/+1
|
* event_report: assert correctness of format endingNick Mathewson2023-07-071-0/+20
| | | | | (Also, document that this static assertion is the reason why you are seeing a confusing error message.)
* tor-error: Add optional tracing supportNick Mathewson2023-07-071-0/+171
The main contribution here is a set of convenience macros for logging error `Report`s. Notably, this macros always logs `Internal` and `BadAspiUsage` errors at `WARN`, unless they are already at `ERROR` or more. This is a little tricky because `tracing::event!()` requires its Level argument to be a constant.