diff options
Diffstat (limited to 'kittybox-rs/src')
-rw-r--r-- | kittybox-rs/src/database/file/mod.rs | 8 | ||||
-rw-r--r-- | kittybox-rs/src/database/mod.rs | 2 | ||||
-rw-r--r-- | kittybox-rs/src/frontend/mod.rs | 6 | ||||
-rw-r--r-- | kittybox-rs/src/frontend/onboarding.rs | 4 | ||||
-rw-r--r-- | kittybox-rs/src/indieauth/mod.rs | 1 | ||||
-rw-r--r-- | kittybox-rs/src/main.rs | 1 |
6 files changed, 6 insertions, 16 deletions
diff --git a/kittybox-rs/src/database/file/mod.rs b/kittybox-rs/src/database/file/mod.rs index f83e682..bafb7bf 100644 --- a/kittybox-rs/src/database/file/mod.rs +++ b/kittybox-rs/src/database/file/mod.rs @@ -9,7 +9,7 @@ use std::path::{Path, PathBuf}; use tokio::fs::{File, OpenOptions}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::task::spawn_blocking; -use tracing::debug; +use tracing::{debug, error}; impl From<std::io::Error> for StorageError { fn from(source: std::io::Error) -> Self { @@ -250,7 +250,7 @@ async fn hydrate_author<S: Storage>( None => json!(i), }, Err(e) => { - log::error!("Error while hydrating post {}: {}", url, e); + error!("Error while hydrating post {}: {}", url, e); json!(i) } } @@ -583,14 +583,14 @@ impl Storage for FileStorage { #[tracing::instrument(skip(self))] async fn get_setting(&self, setting: Settings, user: &'_ str) -> Result<String> { - log::debug!("User for getting settings: {}", user); + debug!("User for getting settings: {}", user); let url = axum::http::Uri::try_from(user).expect("Couldn't parse a URL"); let mut path = relative_path::RelativePathBuf::new(); path.push(url.authority().unwrap().to_string()); path.push("settings"); let path = path.to_path(&self.root_dir); - log::debug!("Getting settings from {:?}", &path); + debug!("Getting settings from {:?}", &path); let setting = setting.to_string(); let mut file = File::open(path).await?; let mut content = String::new(); diff --git a/kittybox-rs/src/database/mod.rs b/kittybox-rs/src/database/mod.rs index 10fbc72..9072d9d 100644 --- a/kittybox-rs/src/database/mod.rs +++ b/kittybox-rs/src/database/mod.rs @@ -544,8 +544,8 @@ mod tests { macro_rules! file_test { ($func_name:ident) => { #[tokio::test] + #[tracing_test::traced_test] async fn $func_name() { - test_logger::ensure_env_logger_initialized(); let tempdir = tempdir::TempDir::new("file").expect("Failed to create tempdir"); let backend = super::super::FileStorage::new( tempdir.path().to_path_buf() diff --git a/kittybox-rs/src/frontend/mod.rs b/kittybox-rs/src/frontend/mod.rs index bc9925f..00d3ba6 100644 --- a/kittybox-rs/src/frontend/mod.rs +++ b/kittybox-rs/src/frontend/mod.rs @@ -14,8 +14,6 @@ pub mod onboarding; use kittybox_templates::{Entry, ErrorPage, Feed, MainPage, Template, VCard, POSTS_PER_PAGE}; -pub use kittybox_util::IndiewebEndpoints; - #[derive(Debug, Deserialize)] pub struct QueryParams { after: Option<String>, @@ -143,7 +141,6 @@ pub async fn homepage<D: Storage>( Template { title: &blogname, blog_name: &blogname, - endpoints: None, // XXX this will be deprecated soon anyway feeds: channels, user, content: MainPage { @@ -182,7 +179,6 @@ pub async fn homepage<D: Storage>( Template { title: &blogname, blog_name: &blogname, - endpoints: None, // XXX this will be deprecated soon anyway feeds: channels, user, content: ErrorPage { @@ -228,7 +224,6 @@ pub async fn catchall<D: Storage>( Template { title: &blogname, blog_name: &blogname, - endpoints: None, // XXX this will be deprecated soon anyway feeds: channels, user, content: match post.pointer("/type/0").and_then(|i| i.as_str()) { @@ -258,7 +253,6 @@ pub async fn catchall<D: Storage>( Template { title: &blogname, blog_name: &blogname, - endpoints: None, feeds: channels, user, content: ErrorPage { diff --git a/kittybox-rs/src/frontend/onboarding.rs b/kittybox-rs/src/frontend/onboarding.rs index e9eceb2..b498aed 100644 --- a/kittybox-rs/src/frontend/onboarding.rs +++ b/kittybox-rs/src/frontend/onboarding.rs @@ -17,7 +17,6 @@ pub async fn get() -> Html<String> { title: "Kittybox - Onboarding", blog_name: "Kittybox", feeds: vec![], - endpoints: None, user: None, content: OnboardingPage {}.to_string(), } @@ -83,7 +82,7 @@ async fn onboard<D: Storage + 'static>( if feed.name.is_empty() || feed.slug.is_empty() { continue; }; - log::debug!("Creating feed {} with slug {}", &feed.name, &feed.slug); + debug!("Creating feed {} with slug {}", &feed.name, &feed.slug); let (_, feed) = crate::micropub::normalize_mf2( serde_json::json!({ "type": ["h-feed"], @@ -130,7 +129,6 @@ pub async fn post<D: Storage + 'static>( title: "Kittybox - Onboarding", blog_name: "Kittybox", feeds: vec![], - endpoints: None, user: None, content: ErrorPage { code: err.code(), diff --git a/kittybox-rs/src/indieauth/mod.rs b/kittybox-rs/src/indieauth/mod.rs index b7d4597..8a37959 100644 --- a/kittybox-rs/src/indieauth/mod.rs +++ b/kittybox-rs/src/indieauth/mod.rs @@ -66,7 +66,6 @@ async fn authorization_endpoint_get( Html(kittybox_templates::Template { title: "Confirm sign-in via IndieAuth", blog_name: "Kittybox", - endpoints: None, feeds: vec![], // TODO user: None, diff --git a/kittybox-rs/src/main.rs b/kittybox-rs/src/main.rs index 9e81aad..7a363b8 100644 --- a/kittybox-rs/src/main.rs +++ b/kittybox-rs/src/main.rs @@ -5,7 +5,6 @@ use url::Url; #[tokio::main] async fn main() { - // TODO use tracing instead of log use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry}; Registry::default() .with(EnvFilter::from_default_env()) |