Skip to content

Commit 428360a

Browse files
committed
🔨 Ajout système de log
1 parent b538365 commit 428360a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/fr/france/RepertoireCommune.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import java.io.FileNotFoundException;
44
import java.io.FileReader;
5+
import java.io.InputStream;
6+
import java.io.InputStreamReader;
7+
import java.io.Reader;
58
import java.util.ArrayList;
69
import java.util.Collections;
710
import java.util.HashMap;
@@ -10,6 +13,9 @@
1013

1114
import com.opencsv.bean.CsvToBeanBuilder;
1215

16+
import org.apache.commons.logging.Log;
17+
import org.apache.commons.logging.LogFactory;
18+
1319
import fr.france.outils.OutilsString;
1420

1521
/**
@@ -31,6 +37,8 @@
3137
*/
3238
public class RepertoireCommune {
3339

40+
private static final Log log = LogFactory.getLog(RepertoireCommune.class);
41+
3442
private RepertoireCommune() {
3543
throw new IllegalStateException("Class utilitaire");
3644
}
@@ -43,7 +51,7 @@ private static List<Commune> initCommunes() {
4351
result = new CsvToBeanBuilder<Commune>(new FileReader("communes.csv")).withType(Commune.class).build()
4452
.parse();
4553
} catch (IllegalStateException | FileNotFoundException e) {
46-
System.err.println("Le fichier contenant les communes n'a pas été trouvé");
54+
log.error("Le fichier contenant les communes n'a pas été trouvé", e);
4755
}
4856
return result;
4957
}

0 commit comments

Comments
 (0)