import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
+import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.utils.TimeProfiler;
import org.sonar.api.web.Dashboard;
* @since 2.13
*/
public final class RegisterNewDashboards {
+ private static final Logger LOG = LoggerFactory.getLogger(RegisterNewDashboards.class);
+
static final String DEFAULT_DASHBOARD_NAME = "Dashboard";
private final List<DashboardTemplate> dashboardTemplates;
}
public void start() {
- TimeProfiler profiler = new TimeProfiler().start("Register dashboards");
+ TimeProfiler profiler = new TimeProfiler(LOG).start("Register dashboards");
List<DashboardDto> registeredDashboards = Lists.newArrayList();
for (DashboardTemplate template : dashboardTemplates) {
}
private void activate(DashboardDto dashboardDto, int index) {
+ LOG.info("Register dashboard: " + dashboardDto.getName());
ActiveDashboardDto activeDashboardDto = new ActiveDashboardDto()
.setDashboardId(dashboardDto.getId())
.setOrderIndex(index);
activeDashboardDao.insert(activeDashboardDto);
-
- LoggerFactory.getLogger(getClass()).info("New dashboard '" + dashboardDto.getName() + "' registered");
}
protected DashboardDto register(String name, Dashboard dashboard) {
}
public void start() {
- TimeProfiler profiler = new TimeProfiler(LoggerFactory.getLogger(getClass())).start("Register filters");
+ TimeProfiler profiler = new TimeProfiler(LOG).start("Register filters");
for (FilterTemplate template : filterTemplates) {
if (shouldRegister(template.getName())) {
protected FilterDto register(String name, Filter filter) {
FilterDto dto = null;
if (filterDao.findFilter(name) == null) {
+ LOG.info("Register filter: " + name);
dto = createDtoFromExtension(name, filter);
filterDao.insert(dto);
- LOG.info("New filter '" + dto.getName() + "' registered");
}
// and save the fact that is has now already been loaded
loadedTemplateDao.insert(new LoadedTemplateDto(name, LoadedTemplateDto.FILTER_TYPE));
}
public void start() {
- TimeProfiler profiler = new TimeProfiler().start("Register Quality Profiles");
+ TimeProfiler profiler = new TimeProfiler(LOGGER).start("Register Quality Profiles");
session = sessionFactory.getSession();
ListMultimap<String, RulesProfile> profilesByLanguage = loadDefinitions();
for (String language : profilesByLanguage.keySet()) {
String propertyKey = "sonar.profile." + language;
if (settings.getString(propertyKey) == null) {
String defaultProfileName = defaultProfileName(profiles);
- LOGGER.info("Set default profile for " + language + ": " + defaultProfileName);
+ LOGGER.info("Set default " + language + " profile: " + defaultProfileName);
settings.saveProperty(propertyKey, defaultProfileName);
}
}
}
private void register(String language, String name, Collection<RulesProfile> profiles) {
+ LOGGER.info("Register " + language + " profile: " + name);
clean(language, name);
insert(language, name, profiles);
loadedTemplateDao.insert(new LoadedTemplateDto(templateKey(language, name), LoadedTemplateDto.QUALITY_PROFILE_TYPE));
*/
package org.sonar.server.startup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sonar.api.utils.TimeProfiler;
import org.sonar.server.qualitymodel.ModelManager;
public final class RegisterQualityModels {
-
+ private static final Logger LOG = LoggerFactory.getLogger(RegisterQualityModels.class);
private final ModelManager manager;
/**
}
public void start() {
- TimeProfiler profiler = new TimeProfiler().start("Register quality models");
+ TimeProfiler profiler = new TimeProfiler(LOG).start("Register Quality Models");
manager.registerDefinitions();
profiler.stop();
}