From 471d181284028aab0673a4b9d3133995fc92e8d0 Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:17:08 -0800 Subject: [PATCH] Disable production error logging --- README.md | 2 +- src/utils.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c10c1c8..b340a11 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Results from Google Lighthouse ([Libreddit Report](https://lighthouse-dot-webdot For transparency, I hope to describe all the ways Libreddit handles user privacy. -**Logging:** In production (when running the binary, hosting with docker, or using the official instances), Libreddit logs errors. When debugging (running from source without `--release`), Libreddit logs post IDs and URL paths fetched to aid with troubleshooting. +**Logging:** In production (when running the binary, hosting with docker, or using the official instances), Libreddit logs nothing. When debugging (running from source without `--release`), Libreddit logs post IDs and URL paths fetched to aid with troubleshooting. **DNS:** Both official domains (`libredd.it` and `libreddit.spike.codes`) use Cloudflare as the DNS resolver. Though, the sites are not proxied through Cloudflare meaning Cloudflare doesn't have access to user traffic. diff --git a/src/utils.rs b/src/utils.rs index 6a8da60..586d581 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -455,6 +455,7 @@ pub async fn request(path: &str) -> Result { } // If failed to send request Err(e) => { + #[cfg(debug_assertions)] dbg!(format!("{} - {}", url, e)); Err("Couldn't send request to Reddit, this instance may be being rate-limited. Try another.".to_string()) }