summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-08-01 13:46:01 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-08-01 13:49:03 +0200
commit581dd752d5db572450e62054655d2576a4ed0a5b (patch)
treed76fa7649e1d66913b8fc403f2eba2bcd42273c3 /src
parent578d689595a594cf86404bd95ca29bd006c92019 (diff)
Add logging output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r--src/routes/tree.rs3
-rw-r--r--src/tree.rs3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/routes/tree.rs b/src/routes/tree.rs
index 5974a82..f327eff 100644
--- a/src/routes/tree.rs
+++ b/src/routes/tree.rs
@@ -7,6 +7,7 @@ use crate::repository::get_repository_stat;
use crate::routes::error::RepositoryError;
pub async fn tree<'a>(web::Path((repo_name, branch_name, tree_path)): web::Path<(String, String, String)>, data: web::Data<Arc<crate::state::AppState<'a>>>) -> Result<HttpResponse, RepositoryError> {
+ log::debug!("Handler for tree: {}/{}/{}", repo_name, branch_name, tree_path);
let repo_state = data.repos()
.get(&repo_name)
.ok_or_else(|| RepositoryError::RepoNotFound)?;
@@ -42,6 +43,7 @@ pub async fn tree<'a>(web::Path((repo_name, branch_name, tree_path)): web::Path<
match tree_object.content {
crate::tree::TreeObjectContent::File { size, content, is_binary } => {
+ log::debug!("Rendering File with");
let content = crate::highlight::highlight(&content, data.theme())
.map_err(|e| RepositoryError::Str(e.to_string()))?;
let content = content.value
@@ -67,6 +69,7 @@ pub async fn tree<'a>(web::Path((repo_name, branch_name, tree_path)): web::Path<
},
crate::tree::TreeObjectContent::Dir { content } => {
+ log::debug!("Rendering directory with: {:?}", content);
let content = content.into_iter()
.map(|tree_object_meta| {
crate::templates::tree::TreeElement {
diff --git a/src/tree.rs b/src/tree.rs
index 2555b10..b7de7ea 100644
--- a/src/tree.rs
+++ b/src/tree.rs
@@ -88,6 +88,7 @@ pub fn load_tree_at(repo: &git2::Repository, root: &git2::Tree, path: &[&str]) -
use resiter::AndThen;
if let Some(first_path_element) = path.get(0) {
+ log::trace!("Looking at {}", first_path_element);
root.iter()
.map(|elem| {
let name = elem.name()
@@ -104,7 +105,7 @@ pub fn load_tree_at(repo: &git2::Repository, root: &git2::Tree, path: &[&str]) -
log::trace!("Having tree at {}", elem_name);
if path.len() == 1 {
// We have a tree and we're done recursing for path
- log::trace!("Found Tree tree at {}", elem_name);
+ log::trace!("Found Tree at {}", elem_name);
Ok(Some({
TreeObject {
meta: TreeObjectMetadata {