Entferne Info-Logs aus den Worker-Klassen: Reduziere die Protokollierung in ProduceWorker, DirectorWorker und TransportWorker, um die Ausgabe zu optimieren und nur Fehler zu protokollieren.
This commit is contained in:
@@ -126,14 +126,7 @@ impl ProduceWorker {
|
||||
self.base
|
||||
.set_current_step("Process Finished Productions");
|
||||
|
||||
if finished_productions.is_empty() {
|
||||
eprintln!("[ProduceWorker] Keine abgeschlossenen Produktionen gefunden.");
|
||||
} else {
|
||||
eprintln!(
|
||||
"[ProduceWorker] Verarbeite {} abgeschlossene Produktionen.",
|
||||
finished_productions.len()
|
||||
);
|
||||
}
|
||||
// Nur Fehler loggen; keine Debug-Infos
|
||||
|
||||
for production in finished_productions {
|
||||
self.handle_finished_production(&production);
|
||||
@@ -182,15 +175,7 @@ impl ProduceWorker {
|
||||
}
|
||||
};
|
||||
|
||||
if stocks.is_empty() {
|
||||
eprintln!("[ProduceWorker] Keine Stocks für Branch {branch_id} gefunden.");
|
||||
} else {
|
||||
eprintln!(
|
||||
"[ProduceWorker] {} Stocks gefunden für Branch {}.",
|
||||
stocks.len(),
|
||||
branch_id
|
||||
);
|
||||
}
|
||||
// Ruhemodus: keine Info-Logs, nur Fehler
|
||||
|
||||
for stock in stocks {
|
||||
if remaining_quantity <= 0 {
|
||||
@@ -198,35 +183,18 @@ impl ProduceWorker {
|
||||
}
|
||||
|
||||
let free_capacity = stock.total_capacity - stock.filled;
|
||||
eprintln!(
|
||||
"[ProduceWorker] Stock {}: capacity={}, filled={}, free={}",
|
||||
stock.stock_id,
|
||||
stock.total_capacity,
|
||||
stock.filled,
|
||||
free_capacity
|
||||
);
|
||||
// keine Debug-Ausgabe
|
||||
if free_capacity <= 0 {
|
||||
continue;
|
||||
}
|
||||
|
||||
let to_store = min(remaining_quantity, free_capacity);
|
||||
eprintln!(
|
||||
"[ProduceWorker] Versuche Einlagerung: stock={}, product={}, qty={}, quality={}",
|
||||
stock.stock_id,
|
||||
product_id,
|
||||
to_store,
|
||||
quality
|
||||
);
|
||||
// keine Debug-Ausgabe
|
||||
if !self.store_in_stock(stock.stock_id, product_id, to_store, quality) {
|
||||
return false;
|
||||
}
|
||||
remaining_quantity -= to_store;
|
||||
eprintln!(
|
||||
"[ProduceWorker] Eingelagert: stock={}, qty={} (remaining={})",
|
||||
stock.stock_id,
|
||||
to_store,
|
||||
remaining_quantity
|
||||
);
|
||||
// keine Debug-Ausgabe
|
||||
}
|
||||
|
||||
if remaining_quantity == 0 {
|
||||
@@ -358,12 +326,7 @@ impl ProduceWorker {
|
||||
.map_err(|e| crate::db::DbError::new(format!("DB-Verbindung fehlgeschlagen: {e}")))?;
|
||||
|
||||
conn.prepare("insert_inventory", QUERY_INSERT_INVENTORY)?;
|
||||
let rows = conn.execute("insert_inventory", &[&stock_id, &product_id, &quantity, &quality])?;
|
||||
if let Some(row) = rows.get(0) {
|
||||
if let Some(id) = row.get("id") {
|
||||
eprintln!("[ProduceWorker] Insert inventory id={}", id);
|
||||
}
|
||||
}
|
||||
let _rows = conn.execute("insert_inventory", &[&stock_id, &product_id, &quantity, &quality])?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user