mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
added logging to tags command builder
This commit is contained in:
@@ -35,6 +35,9 @@ package sonia.scm.repository.api;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sonia.scm.cache.Cache;
|
||||
import sonia.scm.cache.CacheManager;
|
||||
import sonia.scm.repository.Repository;
|
||||
@@ -69,6 +72,12 @@ public final class TagsCommandBuilder
|
||||
/** name of the cache */
|
||||
static final String CACHE_NAME = "sonia.cache.cmd.tags";
|
||||
|
||||
/**
|
||||
* the logger for TagsCommandBuilder
|
||||
*/
|
||||
private static final Logger logger =
|
||||
LoggerFactory.getLogger(TagsCommandBuilder.class);
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -105,6 +114,12 @@ public final class TagsCommandBuilder
|
||||
|
||||
if (disableCache)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("get tags for repository {} with disabled cache",
|
||||
repository.getName());
|
||||
}
|
||||
|
||||
tags = getTagsFromCommand();
|
||||
}
|
||||
else
|
||||
@@ -115,6 +130,11 @@ public final class TagsCommandBuilder
|
||||
|
||||
if (tags == null)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("get tags for repository {}", repository.getName());
|
||||
}
|
||||
|
||||
tags = getTagsFromCommand();
|
||||
|
||||
if (tags != null)
|
||||
@@ -122,6 +142,11 @@ public final class TagsCommandBuilder
|
||||
cache.put(key, tags);
|
||||
}
|
||||
}
|
||||
else if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("get tags for repository {} from cache",
|
||||
repository.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return tags;
|
||||
|
||||
Reference in New Issue
Block a user