From 77837b3aee24c0e7cde5bff740845c070cae70bc Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 25 Apr 2021 03:01:56 +0200 Subject: [PATCH] Improved code. --- .../logar/app/anonymizer/Anonymizer.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/fr/devinsy/logar/app/anonymizer/Anonymizer.java b/src/fr/devinsy/logar/app/anonymizer/Anonymizer.java index 319db51..188fb15 100644 --- a/src/fr/devinsy/logar/app/anonymizer/Anonymizer.java +++ b/src/fr/devinsy/logar/app/anonymizer/Anonymizer.java @@ -85,16 +85,7 @@ public final class Anonymizer else { System.out.println("== Anonymize log for [" + source.getName() + "]"); - - boolean isAccessFile; - if (source.getName().contains("access")) - { - isAccessFile = true; - } - else - { - isAccessFile = false; - } + boolean isAccessFile = source.getName().contains("access"); File target; if (source.getName().endsWith(".log.gz")) @@ -137,6 +128,12 @@ public final class Anonymizer anon = anonymizeError(log); } + // Make a check. + if (StringUtils.equals(line, anon.getLine())) + { + System.err.println("Anonymize failed detected: " + line); + } + out.println(anon); } catch (IllegalArgumentException exception)