ObjectDirectory: Clean up logging
Externalize the message and log the pack file with absolute path.
Change-Id: I019052dfae8fd96ab67da08b3287d699287004cb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
(cherry picked from commit 9665d86ba1
)
This commit is contained in:
parent
90abad1baa
commit
e6fd4732d0
|
@ -689,6 +689,7 @@ truncatedHunkOldLinesMissing=Truncated hunk, at least {0} old lines is missing
|
||||||
tSizeMustBeGreaterOrEqual1=tSize must be >= 1
|
tSizeMustBeGreaterOrEqual1=tSize must be >= 1
|
||||||
unableToCheckConnectivity=Unable to check connectivity.
|
unableToCheckConnectivity=Unable to check connectivity.
|
||||||
unableToCreateNewObject=Unable to create new object: {0}
|
unableToCreateNewObject=Unable to create new object: {0}
|
||||||
|
unableToReadPackfile=Unable to read packfile {0}
|
||||||
unableToRemovePath=Unable to remove path ''{0}''
|
unableToRemovePath=Unable to remove path ''{0}''
|
||||||
unableToStore=Unable to store {0}.
|
unableToStore=Unable to store {0}.
|
||||||
unableToWrite=Unable to write {0}
|
unableToWrite=Unable to write {0}
|
||||||
|
|
|
@ -748,6 +748,7 @@ public static JGitText get() {
|
||||||
/***/ public String tSizeMustBeGreaterOrEqual1;
|
/***/ public String tSizeMustBeGreaterOrEqual1;
|
||||||
/***/ public String unableToCheckConnectivity;
|
/***/ public String unableToCheckConnectivity;
|
||||||
/***/ public String unableToCreateNewObject;
|
/***/ public String unableToCreateNewObject;
|
||||||
|
/***/ public String unableToReadPackfile;
|
||||||
/***/ public String unableToRemovePath;
|
/***/ public String unableToRemovePath;
|
||||||
/***/ public String unableToStore;
|
/***/ public String unableToStore;
|
||||||
/***/ public String unableToWrite;
|
/***/ public String unableToWrite;
|
||||||
|
|
|
@ -355,7 +355,9 @@ boolean hasPackedObject(AnyObjectId objectId) {
|
||||||
// The hasObject call should have only touched the index,
|
// The hasObject call should have only touched the index,
|
||||||
// so any failure here indicates the index is unreadable
|
// so any failure here indicates the index is unreadable
|
||||||
// by this process, and the pack is likewise not readable.
|
// by this process, and the pack is likewise not readable.
|
||||||
LOG.warn("Unable to read packfile " + p.getPackFile(), e);
|
LOG.warn(MessageFormat.format(
|
||||||
|
JGitText.get().unableToReadPackfile,
|
||||||
|
p.getPackFile().getAbsolutePath()), e);
|
||||||
removePack(p);
|
removePack(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -648,7 +650,8 @@ private void handlePackError(IOException e, PackFile p) {
|
||||||
if ((e instanceof CorruptObjectException)
|
if ((e instanceof CorruptObjectException)
|
||||||
|| (e instanceof PackInvalidException)) {
|
|| (e instanceof PackInvalidException)) {
|
||||||
warnTmpl = JGitText.get().corruptPack;
|
warnTmpl = JGitText.get().corruptPack;
|
||||||
LOG.warn("Packfile " + p.getPackFile() + " is corrupted", e);
|
LOG.warn(MessageFormat.format(warnTmpl,
|
||||||
|
p.getPackFile().getAbsolutePath()), e);
|
||||||
// Assume the pack is corrupted, and remove it from the list.
|
// Assume the pack is corrupted, and remove it from the list.
|
||||||
removePack(p);
|
removePack(p);
|
||||||
} else if (e instanceof FileNotFoundException) {
|
} else if (e instanceof FileNotFoundException) {
|
||||||
|
|
Loading…
Reference in New Issue