Skip to content

Commit

Permalink
made the trace-logging less noisy
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Aug 8, 2024
1 parent 4c06722 commit d384d76
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 11 additions & 1 deletion server/src/search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,23 @@ pub struct SearchResults {
time_ms: u128,
}

#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
/// Limit per facet
pub struct Limits {
pub buildings_count: usize,
pub rooms_count: usize,
pub total_count: usize,
}
impl Debug for Limits {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Limits")
.field("building", &self.buildings_count)
.field("rooms", &self.rooms_count)
.field("total", &self.total_count)
.finish()
}
}

impl Default for Limits {
fn default() -> Self {
Self {
Expand Down
12 changes: 7 additions & 5 deletions server/src/search/search_executor/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,15 @@ pub(super) struct GeoEntryQuery {

impl Debug for GeoEntryQuery {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("GeoEntryQuery")
.field("parsed_input", &self.parsed_input)
let mut base = f.debug_struct("GeoEntryQuery");
base.field("parsed_input", &self.parsed_input)
.field("limits", &self.limits)
.field("highlighting", &self.highlighting)
.field("filters", &self.filters)
.field("sorting", &self.sorting)
.finish()
.field("filters", &self.filters);
if !self.sorting.is_empty() {
base.field("sorting", &self.sorting);
}
base.finish()
}
}

Expand Down

0 comments on commit d384d76

Please sign in to comment.