diff options
| author | Christine Dodrill <me@christine.website> | 2020-10-02 18:36:57 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-02 18:36:57 -0400 |
| commit | fa13e57835e487d586024a2e065e8f4b30dc88cd (patch) | |
| tree | e62623fec8d1f3e376453cb33ad0e42b2019b589 /src/handlers/gallery.rs | |
| parent | a6ee2e7e36e8e8fac6f7c5f452cd6a0a06790584 (diff) | |
| download | xesite-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.rs | 3 |
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; |
