simplify logger loop
@@ -35,10 +35,7 @@ pub async fn logger_main(
}
// Loop waiting for and writing error logs from GooseUser threads.
- loop {
- // Wait here until a GooseUser thread sends us an error to log, or all GooseUser threads
- // close the error log channel.
- if let Some(message) = log_receiver.recv().await {
+ while let Some(message) = log_receiver.recv().await {
if let Some(goose_debug) = message {
// All Options are defined above, search for formatted_log.
if let Some(file) = debug_log_file.as_mut() {
@@ -64,10 +61,6 @@ pub async fn logger_main(
// Empty message means it's time to exit.
break;
}
- } else {
- // Pipe is closed, cleanup and exit.
- break;
- }
}
// Cleanup and flush all logs to disk.
