From d175481566a23af1cb40375b85a9059b8761b668 Mon Sep 17 00:00:00 2001 From: nyyu Date: Mon, 15 Mar 2021 23:31:02 +0100 Subject: [PATCH] improve log --- src/data_source.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/data_source.rs b/src/data_source.rs index 916354a..93963a5 100644 --- a/src/data_source.rs +++ b/src/data_source.rs @@ -70,6 +70,7 @@ pub trait DataSource { ); let data = self.get_champ_data_with_win_pourcentage(champ, positions, client); + let mut missing_roles = vec![]; for pos in positions { let mut ok = false; for build in &data { @@ -79,14 +80,17 @@ pub trait DataSource { } } if !ok { - error!( - "{}: Can't get data for {} at {}", - self.get_alias(), - champ.id, - pos - ); + missing_roles.push(pos.to_owned()); } } + if !missing_roles.is_empty() { + error!( + "{}: Can't get data for {} at {}", + self.get_alias(), + champ.id, + missing_roles.join(", ") + ); + } for build in data { let item_set = ItemSet {