Send all the logs we output (#5363)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-10-28 09:29:17 -04:00
committed by GitHub
parent fb95068e4a
commit b295d76454
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -455,7 +455,7 @@ pub struct RequestLog {
temp_path: PathBuf,
}
const LOGS_TO_KEEP: usize = 10;
pub const LOGS_TO_KEEP: usize = 10;
impl RequestLog {
pub fn start<Payload>(model_config: &ModelConfig, payload: &Payload) -> Result<Self>
+2 -1
View File
@@ -1,4 +1,5 @@
use crate::config::paths::Paths;
use crate::providers::utils::LOGS_TO_KEEP;
use crate::session::SessionManager;
use std::fs::{self};
use std::io::Cursor;
@@ -36,7 +37,7 @@ pub async fn generate_diagnostics(session_id: &str) -> anyhow::Result<Vec<u8>> {
log_files.sort_by_key(|e| e.metadata().ok().and_then(|m| m.modified().ok()));
for entry in log_files.iter().rev().take(3) {
for entry in log_files.iter().rev().take(LOGS_TO_KEEP) {
let path = entry.path();
let name = path.file_name().unwrap().to_str().unwrap();
zip.start_file(format!("logs/{}", name), options)?;