Skip to content

Commit

Permalink
Wrap error logging in debug mode check for file import failures
Browse files Browse the repository at this point in the history
- Added a conditional check using `LanguageSystem.isDebugMode()` to ensure that error messages for file import failures are only logged during debugging.
- Improves log cleanliness and prevents unnecessary error logs in production.
  • Loading branch information
KelvenCassamo authored Jan 23, 2025
1 parent 4957bca commit e8aa551
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mz/cassamo/jls/LanguageHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public void startElement(String uri, String localName, String qName, Attributes
try {
initFromFile(importFilePath);
} catch (IOException e) {
System.err.println("Error while importing file: " + importFilePath);
if(LanguageSystem.isDebugMode()){
System.err.println("Error while importing file: " + importFilePath);
}
}
}
} else if (qName.equalsIgnoreCase("language")) {
Expand Down

0 comments on commit e8aa551

Please sign in to comment.