diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2016-07-22 14:05:19 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2016-07-26 18:58:17 +0900 |
commit | b8d861bfd5f7d63be0244e2339378533329ef964 (patch) | |
tree | 70160505e93263c5c44b098dfafed72cb96da23d /org.eclipse.jgit | |
parent | 0d872a083700f6e8153069b656d28eb7b7e2e1ec (diff) | |
download | jgit-b8d861bfd5f7d63be0244e2339378533329ef964.tar.gz jgit-b8d861bfd5f7d63be0244e2339378533329ef964.zip |
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>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java index 7ec24998b4..aba5242b14 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -880,10 +880,11 @@ public abstract class Repository implements AutoCloseable { } else if (newCount == -1) { // should not happen, only log when useCnt became negative to // minimize number of log entries - LOG.warn(JGitText.get().corruptUseCnt); if (LOG.isDebugEnabled()) { 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)) { closedAt.set(System.currentTimeMillis()); |