Skip to content

Commit b1b8fba

Browse files
committed
unify path logging
1 parent f9f48cd commit b1b8fba

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private HistoryRevResult getHistoryRev(OutputStream out, String fullpath, String
138138
try {
139139
filename = getGitFilePath(Paths.get(getCanonicalDirectoryName()).relativize(Paths.get(fullpath)).toString());
140140
} catch (IOException e) {
141-
LOGGER.log(Level.WARNING, String.format("Failed to relativize '%s' in for repository '%s'",
141+
LOGGER.log(Level.WARNING, String.format("Failed to relativize '%s' for '%s'",
142142
fullpath, directory), e);
143143
return result;
144144
}
@@ -159,7 +159,7 @@ private HistoryRevResult getHistoryRev(OutputStream out, String fullpath, String
159159
treeWalk.setFilter(PathFilter.create(filename));
160160
if (!treeWalk.next()) {
161161
LOGGER.log(Level.FINEST, "Did not find expected file ''{0}'' in revision {1} " +
162-
"for repository ''{2}''", new Object[] {filename, rev, directory});
162+
"for ''{2}''", new Object[] {filename, rev, directory});
163163
return result;
164164
}
165165

@@ -175,7 +175,7 @@ private HistoryRevResult getHistoryRev(OutputStream out, String fullpath, String
175175
revWalk.dispose();
176176
}
177177
} catch (IOException e) {
178-
LOGGER.log(Level.WARNING, String.format("Failed to get file '%s' in revision %s for repository '%s'",
178+
LOGGER.log(Level.WARNING, String.format("Failed to get file '%s' in revision %s for '%s'",
179179
filename, rev, directory), e);
180180
}
181181

@@ -250,11 +250,11 @@ private String getPathRelativeToCanonicalRepositoryRoot(String fullPath) throws
250250
String findOriginalName(String fullpath, String changeset) throws IOException {
251251

252252
if (fullpath == null || fullpath.isEmpty()) {
253-
throw new IOException(String.format("Invalid file path string: %s", fullpath));
253+
throw new IOException(String.format("Invalid file path string: '%s'", fullpath));
254254
}
255255

256256
if (changeset == null || changeset.isEmpty()) {
257-
throw new IOException(String.format("Invalid changeset string for path %s: %s",
257+
throw new IOException(String.format("Invalid changeset string for '%s': %s",
258258
fullpath, changeset));
259259
}
260260

@@ -525,7 +525,7 @@ public void traverseHistory(File file, String sinceRevision, String tillRevision
525525
}
526526
}
527527
} catch (IOException | ForbiddenSymlinkException e) {
528-
throw new HistoryException(String.format("failed to get history for ''%s''", file), e);
528+
throw new HistoryException(String.format("failed to get history for '%s'", file), e);
529529
}
530530
}
531531

@@ -735,7 +735,7 @@ private void rebuildTagList(File directory) {
735735
commit2Tags.merge(commit, tagName, (oldValue, newValue) -> oldValue + TAGS_SEPARATOR + newValue);
736736
} catch (IOException e) {
737737
LOGGER.log(Level.FINEST,
738-
String.format("cannot get tags for \"%s\"", directory.getAbsolutePath()), e);
738+
String.format("cannot get tags for '%s'", directory.getAbsolutePath()), e);
739739
}
740740
}
741741

@@ -748,12 +748,12 @@ private void rebuildTagList(File directory) {
748748
}
749749
}
750750
} catch (IOException | GitAPIException e) {
751-
LOGGER.log(Level.WARNING, String.format("cannot get tags for \"%s\"", directory.getAbsolutePath()), e);
751+
LOGGER.log(Level.WARNING, String.format("cannot get tags for '%s'", directory.getAbsolutePath()), e);
752752
// In case of partial success, do not null-out tagList here.
753753
}
754754

755755
if (LOGGER.isLoggable(Level.FINER)) {
756-
LOGGER.log(Level.FINER, "Read tags count={0} for {1}",
756+
LOGGER.log(Level.FINER, "Read tags count={0} for ''{1}''",
757757
new Object[] {tagList.size(), directory});
758758
}
759759
}
@@ -798,9 +798,9 @@ protected void buildTagList(File directory, CommandTimeoutType cmdType) {
798798
try {
799799
future.get(RuntimeEnvironment.getInstance().getCommandTimeout(cmdType), TimeUnit.SECONDS);
800800
} catch (InterruptedException | ExecutionException e) {
801-
LOGGER.log(Level.WARNING, "failed tag rebuild for directory " + directory, e);
801+
LOGGER.log(Level.WARNING, String.format("failed tag rebuild for directory '%s'", directory), e);
802802
} catch (TimeoutException e) {
803-
LOGGER.log(Level.WARNING, "timed out tag rebuild for directory " + directory, e);
803+
LOGGER.log(Level.WARNING, String.format("timed out tag rebuild for directory '%s'", directory), e);
804804
}
805805

806806
if (!executor.isTerminated()) {

0 commit comments

Comments
 (0)