Skip to content

Commit ea19790

Browse files
authored
Reduce log spam (#941)
1 parent 1287353 commit ea19790

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/ModelManagerImpl.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ private WurstCompilerJassImpl getCompiler(WurstGui gui) {
373373
}
374374

375375
private void updateModel(CompilationUnit cu, WurstGui gui) {
376-
WLogger.info("update model with " + cu.getCuInfo().getFile());
376+
WLogger.trace("update model with " + cu.getCuInfo().getFile());
377377
parseErrors.put(wFile(cu), new ArrayList<>(gui.getErrorsAndWarnings()));
378378

379379
WurstModel model2 = model;
@@ -518,23 +518,26 @@ private CompilationUnit replaceCompilationUnit(WFile filename, String contents,
518518
}
519519
if (fileHashcodes.containsKey(filename)) {
520520
int oldHash = fileHashcodes.get(filename);
521-
WLogger.info("oldHash = " + oldHash + " == " + contents.hashCode());
522521
if (oldHash == contents.hashCode()) {
523522
// no change
524-
WLogger.info("CU " + filename + " was unchanged.");
523+
WLogger.trace("CU " + filename + " was unchanged.");
525524
return getCompilationUnit(filename);
525+
} else {
526+
WLogger.info("CU changed. oldHash = " + oldHash + " == " + contents.hashCode());
526527
}
527528
}
528529

529-
WLogger.info("replace CU " + filename);
530+
WLogger.trace("replace CU " + filename);
530531
WurstGui gui = new WurstGuiLogger();
531532
WurstCompilerJassImpl c = getCompiler(gui);
532533
CompilationUnit cu = c.parse(filename.toString(), new StringReader(contents));
533534
cu.getCuInfo().setFile(filename.toString());
534535
updateModel(cu, gui);
535536
fileHashcodes.put(filename, contents.hashCode());
536537
if (reportErrors) {
537-
WLogger.info("found " + gui.getErrorCount() + " errors in file " + filename);
538+
if (gui.getErrorCount() > 0) {
539+
WLogger.info("found " + gui.getErrorCount() + " errors in file " + filename);
540+
}
538541
reportErrors("sync cu " + filename, filename, gui.getErrorsAndWarnings());
539542
}
540543
return cu;

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/languageserver/WurstWorkspaceService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public CompletableFuture<List<? extends SymbolInformation>> symbol(WorkspaceSymb
2727

2828
@Override
2929
public void didChangeConfiguration(DidChangeConfigurationParams params) {
30-
WLogger.info("didChangeConfiguration");
30+
WLogger.trace("didChangeConfiguration");
3131

3232
}
3333

3434
@Override
3535
public void didChangeWatchedFiles(DidChangeWatchedFilesParams params) {
36-
WLogger.info("didChangeWatchedFiles");
36+
WLogger.trace("didChangeWatchedFiles");
3737
server.worker().handleFileChanged(params);
3838
}
3939

0 commit comments

Comments
 (0)