本文整理汇总了Java中jetbrains.buildServer.log.Loggers类的典型用法代码示例。如果您正苦于以下问题:Java Loggers类的具体用法?Java Loggers怎么用?Java Loggers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Loggers类属于jetbrains.buildServer.log包,在下文中一共展示了Loggers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: persist
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
public void persist() throws IOException {
if (!configFile.getParentFile().exists() && configFile.getParentFile().mkdirs()) {
Loggers.SERVER.info("Directory created for the Hub configuration file at : " + configFile.getParentFile().getCanonicalPath());
} else if (configFile.exists() && configFile.delete()) {
Loggers.SERVER.info("Old Hub configuration file removed, to be replaced by a new configuration.");
}
configFile.createNewFile();
final JsonObject globalConfigJson = new JsonObject();
final JsonElement hubServerConfigJson = gson.toJsonTree(getHubServerConfig(), HubServerConfig.class);
globalConfigJson.add("hubServerConfig", hubServerConfigJson);
globalConfigJson.addProperty("hubWorkspaceCheck", hubWorkspaceCheck);
try (BufferedWriter writer = new BufferedWriter(new FileWriter(configFile))) {
writer.write(gson.toJson(globalConfigJson));
} catch (final IOException e) {
Loggers.SERVER.error("Failed to save Hub config file: " + configFile, e);
}
}
示例2: fillModel
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
@Override
public void fillModel(final Map<String, Object> model, final HttpServletRequest request) {
try {
final String hubRiskReportUrl = getRiskReportUrl(request, server);
model.put("hubRiskReportUrl", hubRiskReportUrl);
final HubResourceBundleHelper bundle = new HubResourceBundleHelper();
bundle.setKeyPrefix("hub.riskreport");
if (request.getLocale() != null) {
bundle.setLocale(request.getLocale());
}
model.put("bundle", bundle);
} catch (final Exception e) {
Loggers.SERVER.error("Could not read the risk report file: " + e.getMessage());
}
model.put("teamcityBaseUrl", UrlUtil.createTeamcityBaseUrl(request));
}
示例3: loadConfiguration
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
void loadConfiguration(){
if(configFile.exists()){
FileInputStream configFileStream = null;
try {
configFileStream = new FileInputStream(configFile);
ConfigurationSerializable configurationSerializable = ConfigurationSerializable.class.cast(xStream.fromXML(configFile));
Collection<AccountSerializable> accounts = configurationSerializable.getAccounts();
if(accounts != null){
for(AccountSerializable account : accounts){
addAccount(account);
}
}
} catch (IOException e) {
Loggers.SERVER.error("Failed to load automate.website config file: " + configFile, e);
} finally {
IOUtils.closeQuietly(configFileStream);
}
}
}
示例4: getBuildRunnerInfo
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
@NotNull
public AgentBuildRunnerInfo getBuildRunnerInfo() {
return new AgentBuildRunnerInfo() {
@NotNull
public String getType() {
return DotNetBuildConstants.BUILD_RUNNER_TYPE;
}
public boolean canRun(@NotNull BuildAgentConfiguration buildAgentConfiguration) {
if (!buildAgentConfiguration.getSystemInfo().isWindows()) {
Loggers.SERVER.debug(getType() + " runner is supported only under Windows platform");
return false;
}
return true;
}
};
}
示例5: getSinCityFeature
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
/**
* Look through the build type's build features and return a feature descriptor for the SinCity feature if it's
* enabled.
* <p/>
* We only allow a single SinCity feature (see SinCityBuildFeature.isMultipleFeaturesPerBuildTypeAllowed()) so this
* either returns an instance or null.
*
* @param buildType the build configuration to inspect
* @return an SBuildFeatureDescriptor corresponding to SinCity, or null
*/
@Nullable
public static SBuildFeatureDescriptor getSinCityFeature(@NotNull SBuildType buildType) {
for (SBuildFeatureDescriptor feature : buildType.getBuildFeatures()) {
final Class<? extends BuildFeature> featureClass = feature.getBuildFeature().getClass();
Loggers.SERVER.debug("[SinCity] found plugin: " + featureClass);
if (!featureClass.equals(SinCityBuildFeature.class))
continue;
Loggers.SERVER.debug("[SinCity] found SinCity");
if (!buildType.isEnabled(feature.getId()))
return null;
Loggers.SERVER.debug("[SinCity] SinCity enabled");
return feature;
}
return null;
}
示例6: CulpritFinder
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
/**
* Run culprit finding between oldBuild and newBuild.
* @param newBuild the top of the culprit-finding range. Can be an SFinishedBuild (for manually triggered builds) or
* an SRunningBuild (the finishing build for automatically triggered builds).
* @param oldBuild the bottom of the culprit-finding range. Can be null if newBuild is the only build so far in the
* build configuration.
* @param triggerOnBuildProblem
* @param triggerOnTestFailure
* @param buildCustomizerFactory
* @param putBuildsToQueueTop should the culprit finding builds be given higher priority?
* @param triggeredBy identify who triggered the batch; this is only used in the "triggered by" message
*/
public CulpritFinder(@NotNull SBuild newBuild,
@Nullable SFinishedBuild oldBuild,
@NotNull String triggerOnBuildProblem,
@NotNull String triggerOnTestFailure,
@NotNull BuildCustomizerFactory buildCustomizerFactory,
@NotNull BuildQueue buildQueue,
boolean putBuildsToQueueTop,
@NotNull String triggeredBy) {
this.newBuild = newBuild;
this.oldBuild = oldBuild;
this.buildCustomizerFactory = buildCustomizerFactory;
this.triggerOnBuildProblem = triggerOnBuildProblem;
this.triggerOnTestFailure = triggerOnTestFailure;
this.buildQueue = buildQueue;
this.putBuildsToQueueTop = putBuildsToQueueTop;
this.triggeredBy = triggeredBy;
Loggers.SERVER.debug("[SinCity] culprit finding " +
(oldBuild == null
? "for"
: "between [" + oldBuild + "] and") +
" [" + newBuild + "]");
}
示例7: triggerCulpritFinding
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
private void triggerCulpritFinding(List<SVcsModification> changesBetweenBuilds)
{
List<SVcsModification> suspectChanges = new ArrayList<SVcsModification>(changesBetweenBuilds);
suspectChanges.remove(0);
Collections.reverse(suspectChanges);
BuildCustomizer buildCustomizer = buildCustomizerFactory.createBuildCustomizer(newBuild.getBuildType(), null);
for (SVcsModification change : suspectChanges) {
Loggers.SERVER.info("[SinCity] Queueing change '" + change + "' having failed build " + newBuild);
Map<String, String> buildParameters = getCommonBuildParameters();
buildParameters.put(new ParameterNames().getSincitySuspectChange(), change.getVersion());
buildCustomizer.setParameters(buildParameters);
buildCustomizer.setChangesUpTo(change);
SQueuedBuild queuedBuild = buildCustomizer.createPromotion().addToQueue(
triggeredBy + "; investigating failures between " + (oldBuild == null ? "the Big Bang" : oldBuild.getBuildNumber()) + " and " + newBuild.getBuildNumber());
if (putBuildsToQueueTop)
moveBuildBeyondAllCulpritFindingBuilds(queuedBuild);
}
}
示例8: tagBuild
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
/**
* Tag the finishing build (if requested in the config) as either
* 1) triggered by SinCity
* 2) not triggered by SinCity
*/
void tagBuild() {
// tag the finished build
SettingNames settingNames = new SettingNames();
// if this is a SinCity-triggered build, we know for sure that the getSincityRangeTopBuildId() parameter is set;
// if, on the other hand, it is a non-SinCity-triggered run, it may still be set (and hopefully empty) if the
// user has set the parameter up in their build configuration; therefore, don't just test for null and accept
// empty as a sign of a non-SinCity-triggered build
final String sincityRangeTopBuildId = build.getParametersProvider().get(new ParameterNames().getSincityRangeTopBuildId());
String tagParameterName = StringUtil.isEmpty(sincityRangeTopBuildId)
? settingNames.getTagNameForBuildsNotTriggeredBySinCity()
: settingNames.getTagNameForBuildsTriggeredBySinCity();
String unresolvedTagName = sinCityParameters.get(tagParameterName);
if (StringUtil.isEmpty(unresolvedTagName))
return;
ValueResolver resolver = build.getValueResolver();
final String resolvedTagName = resolver.resolve(unresolvedTagName).getResult();
Loggers.SERVER.debug("[SinCity] tagging build with '" + resolvedTagName + "'");
final List<String> resultingTags = new ArrayList<String>(build.getTags());
resultingTags.add(resolvedTagName);
build.setTags(resultingTags);
}
示例9: writeParameterToFileIfSet
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
private void writeParameterToFileIfSet(String parameterName, String filePath) {
final Map<String, String> configParameters = build.getSharedConfigParameters();
if (!configParameters.containsKey(parameterName)) {
Loggers.AGENT.debug("[SinCity] the " + parameterName + " parameter is not set");
return;
}
String parameterValue = configParameters.get(parameterName);
if (StringUtil.isEmpty(parameterValue)) {
Loggers.AGENT.debug("[SinCity] the " + parameterName + " is empty");
return;
}
writeStringToFile(parameterValue, filePath);
}
示例10: process
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
@Override
public Collection<InvalidProperty> process(Map<String, String> map) {
List<InvalidProperty> result = new ArrayList<InvalidProperty>();
Loggers.SERVER.info(map.toString());
String runFrom = map.get(SettingsConst.PROP_RUN_FROM);
String jarPath = map.get(SettingsConst.PROP_JAR_PATH);
if (runFrom.equals(RunFromConst.JAR) && PropertiesUtil.isEmptyOrNull(jarPath)) {
result.add(new InvalidProperty(SettingsConst.PROP_JAR_PATH, Dictionary.ERROR_JAR_PATH_EMPTY));
}
RunnerParamProvider runnerParamProvider = new RunnerParamProvider();
for (RunnerParam runnerParam : runnerParamProvider.all()) {
try {
String value = runnerParam.process(map.get(runnerParam.getName()));
if (value == null) {
map.remove(runnerParam.getName());
} else {
map.put(runnerParam.getName(), value);
}
} catch (ValidationException e) {
result.add(new InvalidProperty(runnerParam.getName(), e.getMessage()));
}
}
return result;
}
示例11: PasswordResetController
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
public PasswordResetController(final SBuildServer sBuildServer,
final WebControllerManager webControllerManager,
final PluginDescriptor pluginDescriptor,
final AuthorizationInterceptor authorisationInterceptor,
final UserModel userModel,
final SBuildServer buildServer,
final SmtpConfigProcessor smtpConfigProcessor
) {
super(sBuildServer);
this.webControllerManager = webControllerManager;
this.pluginDescriptor = pluginDescriptor;
this.authorisationInterceptor = authorisationInterceptor;
this.userModel = userModel;
this.buildServer = buildServer;
this.smtpConfigProcessor = smtpConfigProcessor;
this.logger = Loggers.SERVER;
}
示例12: agentStarted
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
@Override
public void agentStarted(@NotNull BuildAgent agent) {
checkReady();
try {
startSeeder();
} catch (IOException e) {
LOG.warnAndDebugDetails("error start seeder on agent started", e);
}
LogManager.getLogger("com.turn.ttorrent", new LoggerFactory() {
@Override
public org.apache.log4j.Logger makeNewLoggerInstance(String s) {
return org.apache.log4j.Logger.getLogger(Loggers.AGENT_CATEGORY);
}
});
}
示例13: startSeeder
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
private void startSeeder() throws IOException {
final URI trackerAnnounceUrlLocal = myTrackerAnnounceUrl;
if (trackerAnnounceUrlLocal == null) {
Loggers.AGENT.error("Announce url is null. Seeding is disabled");
return;
}
String ownAddress = myTrackerManager.getOwnTorrentAddress();
final String agentAddressPrefix = myTrackerManager.getAgentAddressPrefix();
final InetAddress[] selfAddresses;
if (!ownAddress.isEmpty()) {
selfAddresses = new InetAddress[]{InetAddress.getByName(ownAddress)};
} else if (!agentAddressPrefix.isEmpty()) {
selfAddresses = NetworkUtil.getSelfAddresses(new Filter<InetAddress>() {
@Override
public boolean accept(@NotNull InetAddress data) {
return data.getHostAddress().startsWith(agentAddressPrefix);
}
});
} else {
selfAddresses = NetworkUtil.getSelfAddresses(null);
}
myTorrentsSeeder.start(selfAddresses, trackerAnnounceUrlLocal, myAnnounceIntervalSec);
}
示例14: AgentConfiguration
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
public AgentConfiguration(@NotNull final EventDispatcher<AgentLifeCycleListener> dispatcher,
@NotNull final BuildAgentConfiguration buildAgentConfiguration,
@NotNull CurrentBuildTracker currentBuildTracker) {
myCurrentBuildTracker = currentBuildTracker;
myBuildAgentConfiguration = buildAgentConfiguration;
dispatcher.addListener(new AgentLifeCycleAdapter() {
@Override
public void afterAgentConfigurationLoaded(@NotNull BuildAgent agent) {
String serverUrl = agent.getConfiguration().getServerUrl();
if (StringUtil.isNotEmpty(serverUrl)) {
myXmlRpcTarget = XmlRpcFactory.getInstance().create(serverUrl, "TeamCity Agent", 30000, false);
} else {
Loggers.AGENT.error("Cannot create RPC instance for torrent plugin: server url is not specified");
}
}
});
}
示例15: call
import jetbrains.buildServer.log.Loggers; //导入依赖的package包/类
@NotNull
private <T> T call(@NotNull String methodName, @NotNull final T defaultValue) {
final XmlRpcTarget xmlRpcTargetLocal = myXmlRpcTarget;
if (xmlRpcTargetLocal == null) {
Loggers.AGENT.warn("RPC object is not initialized");
return defaultValue;
}
try {
final Object retval = xmlRpcTargetLocal.call(XmlRpcConstants.TORRENT_CONFIGURATION + "." + methodName, new Object[0]);
if (retval == null) {
Loggers.AGENT.warn("method " + methodName + " cannot be invoked via RPC");
return defaultValue;
}
return (T) retval;
} catch (Exception e) {
Loggers.AGENT.warnAndDebugDetails("method " + methodName + " cannot be invoked via RPC", e);
return defaultValue;
}
}