Skip to content

Commit

Permalink
Adding KONVEYOR_LOG prefix to make provider able to log
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Hurley <[email protected]>
  • Loading branch information
shawn-hurley committed Jul 11, 2024
1 parent 9e747bb commit 7902cac
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,20 @@ private static List<SymbolInformation> search(String projectName, ArrayList<Stri
// For Partial results, we are going to filter out based on a list in the engine
int s = IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS | IJavaSearchScope.APPLICATION_LIBRARIES;
if (analsysisMode.equals(sourceOnlyAnalysisMode)) {
logInfo("source-only analysis mode only scoping to Sources");
logInfo("KONVEYOR_LOG: source-only analysis mode only scoping to Sources");
s = IJavaSearchScope.SOURCES;
} else {
logInfo("waiting for source downloads");
logInfo("KONVEYOR_LOG: waiting for source downloads");
waitForJavaSourceDownloads();
logInfo("waited for source downloads");
logInfo("KONVEYOR_LOG: waited for source downloads");
}

for (IJavaProject iJavaProject : targetProjects) {
var errors = ResourceUtils.getErrorMarkers(iJavaProject.getProject());
var warnings = ResourceUtils.getWarningMarkers(iJavaProject.getProject());
logInfo("for project: " + iJavaProject + " found errors: " + errors + " warnings: " + warnings);
logInfo("KONVEYOR_LOG:" +
" found errors: " + errors.toString().replace("\n", " ") +
" warnings: " + warnings.toString().replace("\n", " "));
}

IJavaSearchScope scope;
Expand Down Expand Up @@ -216,10 +218,10 @@ private static List<SymbolInformation> search(String projectName, ArrayList<Stri
pattern = mapLocationToSearchPatternLocation(location, query);
} catch (Exception e) {
// TODO Auto-generated catch block
logInfo("Unable to get search pattern: " + e);
logInfo("KONVEYOR_LOG: Unable to get search pattern: " + e.toString().replace("\n", " "));
throw e;
}
logInfo("pattern: " + pattern);
logInfo("KONVEYOR_LOG: pattern: " + pattern.toString().replace("\n", " "));

SearchEngine searchEngine = new SearchEngine();

Expand All @@ -235,10 +237,13 @@ private static List<SymbolInformation> search(String projectName, ArrayList<Stri
searchEngine.search(pattern, participents, scope, requestor, monitor);
} catch (Exception e) {
//TODO: handle exception
logInfo("unable to get search " + e);
logInfo("KONVEYOR_LOG: unable to get search " + e.toString().replace("\n", " "));
}

logInfo("got: " + requestor.getAllSearchMatches() + " search matches for " + query + " location " + location);
logInfo("KONVEYOR_LOG: got: " + requestor.getAllSearchMatches() +
" search matches for " + query +
" location " + location
+ " matches" + requestor.getSymbols().size());

return requestor.getSymbols();

Expand Down

0 comments on commit 7902cac

Please sign in to comment.