Repository: Log negative useCnt message together with stack trace
The message "close() called when useCnt is already zero" is logged with level warning, and then if debug logging is enabled, the stack trace is logged separately with level debug. Log the message and the stack trace in the same call, so that they always appear together in the output rather than potentially interleaved with other log statements. Change-Id: I1b5c1557ddc2d19f3f5b29baec96e62bc467d88a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
0d872a0837
commit
b8d861bfd5
|
@ -880,10 +880,11 @@ public void close() {
|
||||||
} else if (newCount == -1) {
|
} else if (newCount == -1) {
|
||||||
// should not happen, only log when useCnt became negative to
|
// should not happen, only log when useCnt became negative to
|
||||||
// minimize number of log entries
|
// minimize number of log entries
|
||||||
LOG.warn(JGitText.get().corruptUseCnt);
|
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
IllegalStateException e = new IllegalStateException();
|
IllegalStateException e = new IllegalStateException();
|
||||||
LOG.debug("", e); //$NON-NLS-1$
|
LOG.debug(JGitText.get().corruptUseCnt, e);
|
||||||
|
} else {
|
||||||
|
LOG.warn(JGitText.get().corruptUseCnt);
|
||||||
}
|
}
|
||||||
if (RepositoryCache.isCached(this)) {
|
if (RepositoryCache.isCached(this)) {
|
||||||
closedAt.set(System.currentTimeMillis());
|
closedAt.set(System.currentTimeMillis());
|
||||||
|
|
Loading…
Reference in New Issue