Skip to content

Commit 68ef80c

Browse files
committed
Add more logging for /zulip-hook requests
1 parent 1cdce75 commit 68ef80c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ async fn serve_req(
151151
payload.extend_from_slice(&chunk);
152152
}
153153

154+
log::info!("/zulip-hook request body: {:?}", str::from_utf8(&payload));
154155
let req = match serde_json::from_slice(&payload) {
155156
Ok(r) => r,
156157
Err(e) => {

src/zulip.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ async fn handle_command<'a>(
188188
}
189189

190190
let cmd = parse_cli::<ChatCommand, _>(words.into_iter())?;
191+
tracing::info!("command parsed to {cmd:?} (impersonated: {impersonated})");
192+
191193
let output = match &cmd {
192194
ChatCommand::Acknowledge { identifier } => {
193195
acknowledge(&ctx, gh_id, identifier.into()).await
@@ -249,7 +251,10 @@ async fn handle_command<'a>(
249251
if cmd_index >= words.len() {
250252
return Ok(Some("Unknown command".to_string()));
251253
}
254+
252255
let cmd = parse_cli::<StreamCommand, _>(words[cmd_index..].into_iter().copied())?;
256+
tracing::info!("command parsed to {cmd:?}");
257+
253258
match cmd {
254259
StreamCommand::EndTopic => post_waiter(&ctx, message_data, WaitingMessage::end_topic())
255260
.await

0 commit comments

Comments
 (0)