4343@ Slf4j
4444public class Main {
4545
46- private static final org .slf4j .Marker CONSOLE_ONLY = MarkerFactory .getMarker ("CONSOLE_ONLY" );
47- private static final org .slf4j .Marker LOGFILE_ONLY = MarkerFactory .getMarker ("FILE_ONLY" );
48-
4946 private static final String REPLACED_FILENAME_CHARS = "[.,:/?\" <>|*\\ \\ ]+" ;
5047
5148 private static final String EXTENSION_HTML = ".html" ;
@@ -67,7 +64,6 @@ public static void main(String[] args) {
6764 log .info ("-{} (--{}) {}" , option .getOpt (), option .getLongOpt (), option .getDescription ()));
6865 return ;
6966 }
70- System .out .print ("EToolbox AnyDiff " );
7167 AnyDiff anyDiff = new AnyDiff ()
7268 .left (runArguments .getLeft ())
7369 .right (runArguments .getRight ());
@@ -194,8 +190,9 @@ private static void printHead(int allCount, long pendingCount) {
194190 log .info (line );
195191 log .info (StringUtils .repeat (Constants .EQUALS , line .length () - 1 ));
196192 } else {
197- log . info ( String .format ("\n Found %d new difference(-s)" , pendingCount ) );
193+ String line = String .format ("\n Found %d new difference(-s)" , pendingCount );
198194 String secondLine = String .format ("There are also %d accepted difference(-s)" , allCount - pendingCount );
195+ log .info (line );
199196 log .info (secondLine );
200197 log .info (StringUtils .repeat (Constants .EQUALS , secondLine .length ()));
201198 }
@@ -216,11 +213,11 @@ private static void print(Diff diff, RunArguments runArguments, boolean isOneOfM
216213 log .info ("No differences" );
217214 }
218215 } else {
219- if (isOneOfMany ) {
216+ if (isOneOfMany && diff . getCount () > 0 ) {
220217 log .info ("{} difference(-s)" , diff .getCount ());
221218 }
222- log .info (CONSOLE_ONLY , diff .toString (OutputType .CONSOLE ));
223- log .info (LOGFILE_ONLY , diff .toString (OutputType .LOG ));
219+ log .info (MarkerFactory . getMarker ( Constants . MARKER_CONSOLE_ONLY ) , diff .toString (OutputType .CONSOLE ));
220+ log .info (MarkerFactory . getMarker ( Constants . MARKER_FILE_ONLY ) , diff .toString (OutputType .LOG ));
224221 }
225222 }
226223
0 commit comments