Skip to content

Commit 741f2ca

Browse files
authored
add more info to repository scan log messages (#3921)
so that it is visible also when adding repositories via API
1 parent b33822c commit 741f2ca

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/HistoryGuru.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,12 @@ public Collection<RepositoryInfo> addRepositories(File[] files) {
545545
try {
546546
repoList.addAll(future.get());
547547
} catch (Exception e) {
548-
LOGGER.log(Level.WARNING, "failed to get results of repository scan");
548+
LOGGER.log(Level.WARNING, "failed to get results of repository scan", e);
549549
}
550550
});
551551

552+
LOGGER.log(Level.FINER, "Discovered repositories: {0}", repoList);
553+
552554
return repoList;
553555
}
554556

opengrok-indexer/src/main/java/org/opengrok/indexer/history/RepositoryInfo.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
2222
* Portions Copyright (c) 2017, 2019, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opengrok.indexer.history;
@@ -344,4 +344,9 @@ public int hashCode() {
344344
hash = 89 * hash + Objects.hashCode(this.directoryNameRelative);
345345
return hash;
346346
}
347+
348+
@Override
349+
public String toString() {
350+
return type + ":" + directoryNameRelative;
351+
}
347352
}

opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,8 @@ public void prepareIndexer(RuntimeEnvironment env,
10091009
}
10101010

10111011
if (!searchPaths.isEmpty()) {
1012-
LOGGER.log(Level.INFO, "Scanning for repositories in {0}...", searchPaths);
1012+
LOGGER.log(Level.INFO, "Scanning for repositories in {0} (down to {1} levels below source root)",
1013+
new Object[]{searchPaths, env.getScanningDepth()});
10131014
Statistics stats = new Statistics();
10141015
env.setRepositories(searchPaths.toArray(new String[0]));
10151016
stats.report(LOGGER, String.format("Done scanning for repositories, found %d repositories",

0 commit comments

Comments
 (0)