refactor(logging): update component names and adjust log levels
Renamed PostgreSQL references to "Tables" for clarity in bootstrap logs, changed config sync logging from info to trace for reduced verbosity, and made session message clearing method private to limit external access.
This commit is contained in:
parent
9c3fde5eb7
commit
8581927d97
3 changed files with 5 additions and 6 deletions
|
|
@ -43,14 +43,13 @@ impl BootstrapManager {
|
|||
);
|
||||
|
||||
if !Self::is_postgres_running() {
|
||||
warn!("PostgreSQL server is not running. Attempting to start 'tables' component...");
|
||||
let pm = PackageManager::new(install_mode.clone(), tenant.clone())
|
||||
.expect("Failed to initialize PackageManager");
|
||||
if let Err(e) = pm.start("tables") {
|
||||
error!("Failed to start PostgreSQL component automatically: {}", e);
|
||||
error!("Failed to start Tables server component automatically: {}", e);
|
||||
panic!("Database not available and auto-start failed.");
|
||||
} else {
|
||||
info!("PostgreSQL component started successfully.");
|
||||
info!("Tables component started successfully.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use diesel::prelude::*;
|
||||
use diesel::pg::PgConnection;
|
||||
use uuid::Uuid;
|
||||
use log::info;
|
||||
use log::{trace};
|
||||
use std::collections::HashMap;
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::Write;
|
||||
|
|
@ -321,7 +321,7 @@ impl ConfigManager {
|
|||
}
|
||||
}
|
||||
|
||||
info!("Synced {} config values for bot {}", updated, bot_id);
|
||||
trace!("Synced {} config values for bot {}", updated, bot_id);
|
||||
|
||||
Ok(updated)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ impl SessionManager {
|
|||
Ok(inserted)
|
||||
}
|
||||
|
||||
pub fn clear_messages(&mut self, _session_id: Uuid) -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
fn _clear_messages(&mut self, _session_id: Uuid) -> Result<(), Box<dyn Error + Send + Sync>> {
|
||||
use crate::shared::models::message_history::dsl::*;
|
||||
|
||||
diesel::delete(message_history.filter(session_id.eq(session_id)))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue