aboutsummaryrefslogtreecommitdiff
path: root/crates/arti/src/logging.rs
Commit message (Collapse)AuthorAgeFilesLines
* Stub out opentelemetry config when feature is disabled.Wesley Aptekar-Cassels9 days1-2/+0
|
* Fix many review comments.Wesley Aptekar-Cassels9 days1-1/+1
| | | | Mostly relating to typos and dependencies.
* Fix cyclic dependency issues.Wesley Aptekar-Cassels2026-08-101-0/+2
|
* tor-config-shared: Stop using Option<Duration>.Wesley Aptekar-Cassels2026-08-101-9/+3
|
* Add new tor-conig-shared crate.Wesley Aptekar-Cassels2026-08-101-1/+2
| | | | | This contains configuration types that are shared between arti and arti-rely.
* arti: Move OpentelemetryConfig to tor-config.Wesley Aptekar-Cassels2026-08-101-117/+13
| | | | | | This will allow this code to be shared between arti and arti-relay. See: #2470
* Split OTLP exporter into separate crate.Wesley Aptekar-Cassels2026-08-101-2/+0
| | | | | This will allow this code to be shared between arti and arti-relay, and will also likely be useful for others in the ecosystem.
* arti: remove string slicesNick Mathewson2026-06-101-2/+1
|
* everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-091-0/+1
| | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
* implement syslog supportAndrew Kloet2026-04-281-0/+46
|
* arti: set_protocol_warning_mode to Warn or Off in setup_loggingmoumenalaoui2026-04-081-5/+6
|
* arti: add protocol_warnings config and wire setup_loggingmoumenalaoui2026-03-271-0/+10
|
* Fix typosTobias Stoeckmann2026-03-241-1/+1
| | | | Typos found with codespell
* arti: Port logging config to dd(TorConfig)Nick Mathewson2026-02-241-130/+69
|
* arti: Resolve unreachable-pub warnings.Nick Mathewson2026-01-131-9/+25
|
* arti: Make logging parent check work with our MSRV.Nick Mathewson2025-11-251-1/+1
|
* arti: use anyhow::Context on a make_directory failure.Nick Mathewson2025-11-241-1/+6
| | | | | This will improve the error message for problems similar to arti#2240, if they recur.
* arti: Allow a logfile with no directory prefix.Nick Mathewson2025-11-241-1/+12
| | | | | | This should fix the main part of arti#2240. This is an instance of arti#2267 ("Path::parent has funny behavior")
* arti: Boyscout fixnield2025-11-131-1/+1
| | | | It seems this config is for tokio-console and not the RPC.
* arti: Warning when opentelemetry config is set but not build with featurenield2025-11-131-0/+16
|
* arti: better error when tokio-console in cfg but feature is absent.Nick Mathewson2025-11-061-3/+27
| | | | | | | This is the pattern we used elsewhere with the "rpc" option. IMO, this kind of thing is another argument in favor if arti#1704 (redoing config types using derive-deftly.)
* arti: Experimental support for tokio-consoleNick Mathewson2025-11-061-0/+36
| | | | | | This is controlled by a new option, `logging.tokio_console.enabled`. It requires building with `--cfg tokio_unstable`. See documentation and comments for more information.
* arti: Make panic into error on invalid OTEL endpoint.Wesley Aptekar-Cassels2025-09-241-3/+5
|
* arti: Add note about lack of filtering in OpenTelemetry layer.Wesley Aptekar-Cassels2025-09-241-0/+3
|
* opentelemetry: Use humantime_serde for parsing Durations.Wesley Aptekar-Cassels2025-09-241-0/+3
|
* opentelemetry: Panic if configured for non-localhost HTTP endpoint.Wesley Aptekar-Cassels2025-09-241-0/+8
| | | | | | | | | We may want to add a way to opt out of this check, if someone asks for it. Checking for "localhost" and "127.0.0.1" is not a very robust check for a loopback interface, and it's possible that there could be other situations we can't detect where HTTP is safe (private network, WireGuard tunnel, etc). But I don't expect those to be likely to come up in practice, so this should be fine for now.
* arti: Add experimental support for OpenTelemetry.Wesley Aptekar-Cassels2025-09-241-0/+168
|
* arti: log error fields lastSteven Engler2025-08-181-0/+5
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-4/+4
| | | | | | | | | | | | | | 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.
* Update code for Edition 2024Nick Mathewson2025-08-071-3/+3
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* arti console logging: use stderr instead of stdoutJim Newsome2025-06-171-3/+3
| | | | Fixes #2024
* arti: Disable color when stdout is not a tty.Nick Mathewson2025-02-241-1/+7
| | | | | Closes #1763. Closes #1862.
* update `CfgPath::path` to use a `CfgPathResolver`Steven Engler2024-11-181-5/+14
| | | | | | | | | | | | | | | | This is a big change across multiple crates since there isn't a good way to break it up. This changes the signature of `CfgPath::path` to: ``` pub fn path(&self, path_resolver: &CfgPathResolver) -> Result<PathBuf, CfgPathError> { ``` Making this change means that our global `CfgPathResolver` needs to be stored in the 'arti-client' library instead of `tor-config-path`, and must be passed through to anything that calls `path` to expand the variables.
* tor-config: removed re-export of `CfgPath`Steven Engler2024-11-041-1/+2
| | | | | Also updated other packages to get `CfgPath` directly from `tor-config-path' instead of 'tor-config'.
* Match previous backtrace formattingRobin Leander Schröder2024-08-081-2/+2
| | | | | std::backtrace::Backtrace's Display looks the same as backtrace_rs::Backtrace's Debug
* Use std::backtrace instead of backtrace crateRobin Leander Schröder2024-08-011-3/+1
| | | | | Removes resolve_backtraces from rtmock since it is no longer needed as stdlib's backtraces automatically lazily resolve without needing a &mut.
* arti: Don't output ANSI escape codes when logging to file.Gabriela Moldovan2024-02-221-0/+1
| | | | Closes #1298
* educe: Use std's default for enums where default variant is unitIan Jackson2024-02-121-4/+2
| | | | | | | | | | | | | Since Rust 1.66, std's default works properly for enums, provided that the default variant is a unit. Review all uses of `#[educe(default)]` on enums and replace them with std where possible, which is most of them. In 1.66 and later, std's `#[derive(Default)]` doesn't infer any generic bounds on the derived impl, where it's an enum - since the unit variant can always be constructed. So this change doesn't add any generic bounds and is not API-visible.
* Throughout: Use *_report!() macros for reporting Errors.Nick Mathewson2023-07-071-3/+3
| | | | | | | | | | | | | | | I identified the cases to replace by searching for the string `.report()`. There are a few that I didn't change: * A couple of cases that used anyhow::Error, * One case that reported two Errors. * Two cases in `tor_hsclient::err` that just did `error!("Bug: {}")`. I have also not audited the cases in `tor-hsclient` where we're using `tor_error::Report` manually. Nonetheless, closes #949.
* Merge branch 'log_precision' into 'main'Nick Mathewson2023-07-061-4/+25
|\ | | | | | | | | | | | | arti: Add a `logging.time_granularity` option with 1s default. Closes #551 See merge request tpo/core/arti!1376
| * arti: Add a `logging.time_granularity` option with 1s default.Nick Mathewson2023-07-061-4/+25
| | | | | | | | | | | | | | This lets us provide less information in our logs: in particular, it lets us avoid logging with microsecond precision. Closes #551.
* | arti: Note possibility for future use of other tracing panic providerNick Mathewson2023-07-061-0/+5
| |
* | arti: On panic, avoid allocation even more.Nick Mathewson2023-07-061-7/+5
| | | | | | | | | | | | | | | | | | | | The original version of our panic handler would allocate a string for the panic `Location`. But if we're panicking we'd like to keep allocations to a minimum: so instead format the `Location` conditionally. This also drops a useless `std::borrow::Cow`. (The possibility of a "Don't have a `Cow`" commit message was considered and rejected.)
* | Add TODO comments about possibly migrating away from the backtrace crate.Nick Mathewson2023-07-051-1/+2
| |
* | arti: Install a panic hook that sends messages to `tracing`Nick Mathewson2023-07-051-0/+31
|/ | | | | | | (Also leaves installed the default handler that sends messages to stderr.) Closes #921.
* Use ErrorReport/Report for errors in warn! in artiIan Jackson2023-01-301-1/+2
|
* Enforce SafeLogging on the console.Nick Mathewson2022-09-261-30/+10
| | | | | | | | | | | | Previously we always assumed that the console was ephemeral, and so we disabled safe logging. But the console can be piped to journald. And even if we enforce isatty there's no guarantee that the user isn't using some kind of terminal that logs to disk or something. Best just to enable SafeLogging unconditionally. I've added a note about where and how we might re-enable this. Closes #553.
* Mark a few APIs as experimental in docs.Nick Mathewson2022-08-301-0/+1
| | | | | | | | For example, see https://tpo.pages.torproject.net/core/doc/rust/arti/fn.run.html : this isn't labeled as `experimental-api`, but it should be. These APIs were found by poking around in the `arti` crate.
* arti: Raise the default console log severity to "info"Nick Mathewson2022-08-251-1/+1
| | | | | Previously we logged at "debug", but that's not meant to user-facing.
* arti: Move most public APIs behind `experimental-api`.Nick Mathewson2022-08-111-2/+4
| | | | | | | | | | | | | | | | | The remaining unconditionally public APIs are those related to our configuration objects, and the main_main() API. The rationale for making main_main() public is to have an actual entry point. The rationale for making the config APIs public is: 1. We really do intend for others to be able to read our configuration files using this API. 2. The structure of our configuration files is already part of our interface. Closes #530.