Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit a8e84d9

Browse files
authored
Add query logs (#1089)
* add query logs * lower log level
1 parent 8c5d815 commit a8e84d9

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

server/bleep/src/agent.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,14 @@ impl Agent {
256256
.try_fold(
257257
llm_gateway::api::FunctionCall::default(),
258258
|acc, e| async move {
259-
let e: FunctionCall = serde_json::from_str(&e)?;
259+
let e: FunctionCall = serde_json::from_str(&e).map_err(|err| {
260+
tracing::error!(
261+
"Failed to deserialize to FunctionCall: {:?}. Error: {:?}",
262+
e,
263+
err
264+
);
265+
err
266+
})?;
260267
Ok(FunctionCall {
261268
name: acc.name.or(e.name),
262269
arguments: acc.arguments + &e.arguments,

server/bleep/src/indexes/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ impl RepoFile {
724724
let mut buffer = match self.buffer() {
725725
Ok(b) => b,
726726
Err(err) => {
727-
error!(?err, "failed to open file buffer; skipping file");
727+
warn!(?err, "failed to open file buffer; skipping file");
728728
return None;
729729
}
730730
};

server/bleep/src/webserver/answer.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use axum::{
1212
use futures::{future::Either, stream, StreamExt};
1313
use reqwest::StatusCode;
1414
use serde_json::json;
15-
use tracing::{error, warn};
15+
use tracing::{debug, error, info, warn};
1616

1717
use self::conversations::ConversationId;
1818

@@ -91,6 +91,7 @@ pub(super) async fn answer(
9191
Extension(app): Extension<Application>,
9292
Extension(user): Extension<User>,
9393
) -> super::Result<impl IntoResponse> {
94+
info!(?params.q, "handling /answer query");
9495
let query_id = uuid::Uuid::new_v4();
9596

9697
let conversation_id = ConversationId {
@@ -135,6 +136,8 @@ pub(super) async fn answer(
135136
.clone()
136137
.into_owned();
137138

139+
debug!(?query_target, "parsed query target");
140+
138141
let action = Action::Query(query_target);
139142
exchanges.push(Exchange::new(query_id, query));
140143

0 commit comments

Comments
 (0)