Skip to content

Commit

Permalink
We can use the DEBUG env var to display debug infos
Browse files Browse the repository at this point in the history
  • Loading branch information
evrignaud committed Apr 30, 2016
1 parent 52c9e15 commit 5484b4a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/org/fim/internal/StateComparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import static org.fim.model.HashMode.dontHash;

public class StateComparator {
private static boolean logDebugEnabled = Boolean.getBoolean("DEBUG");
private static boolean logDebugEnabled = isLogDebugEnabled();

private final Context context;

Expand Down Expand Up @@ -359,4 +359,12 @@ private FileState findFileWithSameFileName(FileState search, Map<String, FileSta
private List<FileState> findFilesWithSameHash(FileState search, ListMultimap<FileHash, FileState> fileStates) {
return fileStates.get(search.getFileHash());
}

private static boolean isLogDebugEnabled() {
String debug = System.getenv("DEBUG");
if (debug == null) {
return false;
}
return Boolean.parseBoolean(debug);
}
}

0 comments on commit 5484b4a

Please sign in to comment.