use of com.yahoo.vespa.config.server.deploy.DeployHandlerLogger in project vespa by vespa-engine.
the class ApplicationRepository method prepare.
public PrepareResult prepare(Tenant tenant, long sessionId, PrepareParams prepareParams, Instant now) {
validateThatLocalSessionIsNotActive(tenant, sessionId);
LocalSession session = getLocalSession(tenant, sessionId);
ApplicationId applicationId = prepareParams.getApplicationId();
Optional<ApplicationSet> currentActiveApplicationSet = getCurrentActiveApplicationSet(tenant, applicationId);
Slime deployLog = createDeployLog();
DeployLogger logger = new DeployHandlerLogger(deployLog.get().setArray("log"), prepareParams.isVerbose(), applicationId);
ConfigChangeActions actions = session.prepare(logger, prepareParams, currentActiveApplicationSet, tenant.getPath(), now);
logConfigChangeActions(actions, logger);
log.log(LogLevel.INFO, Tenants.logPre(applicationId) + "Session " + sessionId + " prepared successfully. ");
return new PrepareResult(sessionId, actions, deployLog);
}
use of com.yahoo.vespa.config.server.deploy.DeployHandlerLogger in project vespa by vespa-engine.
the class DeployHandlerLoggerTest method testLogging.
private void testLogging(boolean verbose, String expectedPattern) throws IOException {
Slime slime = new Slime();
Cursor array = slime.setArray();
DeployLogger logger = new DeployHandlerLogger(array, verbose, new ApplicationId.Builder().tenant("testtenant").applicationName("testapp").build());
logMessages(logger);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new JsonFormat(true).encode(baos, slime);
assertTrue(Pattern.matches(expectedPattern, baos.toString()));
}
Aggregations