Skip to content

Commit

Permalink
Add back debug logging for primary filter entrypoints
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Cattermole <[email protected]>
  • Loading branch information
adam-cattermole committed Jan 16, 2025
1 parent ddfb7b0 commit 1698f79
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/filter/kuadrant_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ pub(crate) struct KuadrantFilter {
}

impl Context for KuadrantFilter {
fn on_grpc_call_response(&mut self, _token_id: u32, status_code: u32, resp_size: usize) {
fn on_grpc_call_response(&mut self, token_id: u32, status_code: u32, resp_size: usize) {
debug!(
"#{} on_grpc_call_response: received gRPC call response: token: {token_id}, status: {status_code}",
self.context_id
);
let receiver = mem::take(&mut self.grpc_message_receiver_operation)
.expect("We need an operation pending a gRPC response");

Expand All @@ -42,6 +46,11 @@ impl Context for KuadrantFilter {

impl HttpContext for KuadrantFilter {
fn on_http_request_headers(&mut self, _: usize, _: bool) -> Action {
debug!("#{} on_http_request_headers", self.context_id);

#[cfg(feature = "debug-host-behaviour")]
crate::data::debug_all_well_known_attributes();

if let Some(action_sets) = self
.index
.get_longest_match_action_sets(self.request_authority().as_ref())
Expand All @@ -50,13 +59,18 @@ impl HttpContext for KuadrantFilter {
.iter()
.find(|action_set| action_set.conditions_apply(/* self */))
{
debug!(
"#{} action_set selected {}",
self.context_id, action_set.name
);
return self.start_flow(Rc::clone(action_set));
}
}
Action::Continue
}

fn on_http_response_headers(&mut self, _num_headers: usize, _end_of_stream: bool) -> Action {
debug!("#{} on_http_response_headers", self.context_id);
let headers_operations = mem::take(&mut self.headers_operations);
for op in headers_operations {
for (header, value) in &op.headers() {
Expand Down

0 comments on commit 1698f79

Please sign in to comment.