Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-21119] Extend loggning to show assigned priority
Avoid logging twice with fine and finer.
  • Loading branch information
emsa23 committed Jan 1, 2014
1 parent 376d18e commit 197347b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/jenkins/advancedqueue/ItemTransitionLogger.java
Expand Up @@ -23,6 +23,7 @@
*/
package jenkins.advancedqueue;

import java.util.logging.Level;
import java.util.logging.Logger;

import jenkins.advancedqueue.sorter.ItemInfo;
Expand All @@ -36,8 +37,11 @@ public class ItemTransitionLogger {
private final static Logger LOGGER = Logger.getLogger("PrioritySorter.Queue.Items");

static public void logNewItem(ItemInfo info) {
LOGGER.fine("New Item: " + info.toString());
LOGGER.finer("New Item: " + info.toString() + "\n" + info.getDescisionLog());
if (LOGGER.getLevel().intValue() >= Level.FINER.intValue()) {
LOGGER.finer("New Item: " + info.toString() + "\n" + info.getDescisionLog());
} else {
LOGGER.fine("New Item: " + info.toString());
}
}

static public void logBlockedItem(ItemInfo info) {
Expand Down

0 comments on commit 197347b

Please sign in to comment.