aboutsummaryrefslogtreecommitdiff
path: root/src/handlers/gallery.rs
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2020-10-02 18:36:57 -0400
committerGitHub <noreply@github.com>2020-10-02 18:36:57 -0400
commitfa13e57835e487d586024a2e065e8f4b30dc88cd (patch)
treee62623fec8d1f3e376453cb33ad0e42b2019b589 /src/handlers/gallery.rs
parenta6ee2e7e36e8e8fac6f7c5f452cd6a0a06790584 (diff)
downloadxesite-fa13e57835e487d586024a2e065e8f4b30dc88cd.tar.xz
xesite-fa13e57835e487d586024a2e065e8f4b30dc88cd.zip
incorporate tracing instead of log (#222)
* incorporate tracing instead of log * fix a test * fix a test
Diffstat (limited to 'src/handlers/gallery.rs')
-rw-r--r--src/handlers/gallery.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/handlers/gallery.rs b/src/handlers/gallery.rs
index 2094ab2..ba3cba2 100644
--- a/src/handlers/gallery.rs
+++ b/src/handlers/gallery.rs
@@ -8,6 +8,7 @@ use lazy_static::lazy_static;
use prometheus::{IntCounterVec, register_int_counter_vec, opts};
use std::sync::Arc;
use warp::{http::Response, Rejection, Reply};
+use tracing::instrument;
lazy_static! {
static ref HIT_COUNTER: IntCounterVec =
@@ -15,11 +16,13 @@ lazy_static! {
.unwrap();
}
+#[instrument(skip(state))]
pub async fn index(state: Arc<State>) -> Result<impl Reply, Rejection> {
let state = state.clone();
Response::builder().html(|o| templates::galleryindex_html(o, state.gallery.clone()))
}
+#[instrument(skip(state))]
pub async fn post_view(name: String, state: Arc<State>) -> Result<impl Reply, Rejection> {
let mut want: Option<Post> = None;