Skip to content
Permalink
Browse files

Reduce log spam (#941)

  • Loading branch information
Frotty committed Feb 16, 2020
1 parent 1287353 commit ea197901c1be3f9dc0cb1d267ec423f18881639c
@@ -373,7 +373,7 @@ private WurstCompilerJassImpl getCompiler(WurstGui gui) {
}

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

WurstModel model2 = model;
@@ -518,23 +518,26 @@ private CompilationUnit replaceCompilationUnit(WFile filename, String contents,
}
if (fileHashcodes.containsKey(filename)) {
int oldHash = fileHashcodes.get(filename);
WLogger.info("oldHash = " + oldHash + " == " + contents.hashCode());
if (oldHash == contents.hashCode()) {
// no change
WLogger.info("CU " + filename + " was unchanged.");
WLogger.trace("CU " + filename + " was unchanged.");
return getCompilationUnit(filename);
} else {
WLogger.info("CU changed. oldHash = " + oldHash + " == " + contents.hashCode());
}
}

WLogger.info("replace CU " + filename);
WLogger.trace("replace CU " + filename);
WurstGui gui = new WurstGuiLogger();
WurstCompilerJassImpl c = getCompiler(gui);
CompilationUnit cu = c.parse(filename.toString(), new StringReader(contents));
cu.getCuInfo().setFile(filename.toString());
updateModel(cu, gui);
fileHashcodes.put(filename, contents.hashCode());
if (reportErrors) {
WLogger.info("found " + gui.getErrorCount() + " errors in file " + filename);
if (gui.getErrorCount() > 0) {
WLogger.info("found " + gui.getErrorCount() + " errors in file " + filename);
}
reportErrors("sync cu " + filename, filename, gui.getErrorsAndWarnings());
}
return cu;
@@ -27,13 +27,13 @@ public WurstWorkspaceService(WurstLanguageServer server) {

@Override
public void didChangeConfiguration(DidChangeConfigurationParams params) {
WLogger.info("didChangeConfiguration");
WLogger.trace("didChangeConfiguration");

}

@Override
public void didChangeWatchedFiles(DidChangeWatchedFilesParams params) {
WLogger.info("didChangeWatchedFiles");
WLogger.trace("didChangeWatchedFiles");
server.worker().handleFileChanged(params);
}

0 comments on commit ea19790

Please sign in to comment.
You can’t perform that action at this time.