Add debug logging to trace switcher storage/retrieval
Some checks are pending
Botlib CI / build (push) Waiting to run
BotServer CI / build (push) Waiting to run
Bottest CI / build (push) Waiting to run
BotUI CI / build (push) Waiting to run

Added info! logs to add_switcher() and get_switchers() to debug
why switchers are not rendering on stage.
This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-27 20:30:38 -03:00
parent 2cc4fa65df
commit 47988eff92

View file

@ -156,12 +156,11 @@ fn add_switcher(
.arg(switcher_data.to_string())
.query(&mut conn);
trace!(
"Added switcher '{}' ({}) to session {}",
switcher_id,
if is_standard_switcher(first_param) { "standard" } else { "custom" },
user_session.id
);
info!("ADD_SWITCHER: Stored switcher '{}' ({}) to Redis key '{}' for session {}",
switcher_id,
if is_standard_switcher(first_param) { "standard" } else { "custom" },
redis_key,
user_session.id);
} else {
trace!("No cache configured, switcher not added");
}
@ -211,10 +210,15 @@ pub fn get_switchers(
}
}
info!(
"Retrieved {} switchers for session {}",
"Retrieved {} switchers from Redis key '{}' for session {}",
switchers.len(),
redis_key,
session_id
);
// Debug: log each switcher
for sw in &switchers {
info!(" - Switcher: id={}, label={}", sw.id, sw.label.as_deref().unwrap_or(""));
}
}
Err(e) => error!("Failed to get switchers from Redis: {}", e),
}