private BuildActionExecuter<ProviderOperationParameters> createExecuter( ProviderOperationParameters operationParameters) { LoggingServiceRegistry loggingServices; Parameters params = initParams(operationParameters); BuildActionExecuter<BuildActionParameters> executer; if (Boolean.TRUE.equals(operationParameters.isEmbedded())) { loggingServices = this.loggingServices; executer = embeddedExecutor; } else { if (Boolean.TRUE.equals(operationParameters.isColorOutput())) { PrintStream outStr = new PrintStream(operationParameters.getStandardOutput()); DefaultColorMap colourMap = new DefaultColorMap(); colourMap.setUseColor(true); Console console = new AnsiConsole(outStr, outStr, colourMap, true); loggingServices = this.loggingServices.newColoredLogging(console); } else { loggingServices = this.loggingServices.newToolingApiLogging(); } loggingServices .get(OutputEventRenderer.class) .configure(operationParameters.getBuildLogLevel()); ServiceRegistry clientServices = daemonClientFactory.createBuildClientServices( loggingServices.get(OutputEventListener.class), params.daemonParams, operationParameters.getStandardInput(SafeStreams.emptyInput())); executer = clientServices.get(DaemonClient.class); } Factory<LoggingManagerInternal> loggingManagerFactory = loggingServices.getFactory(LoggingManagerInternal.class); return new LoggingBridgingBuildActionExecuter( new DaemonBuildActionExecuter(executer, params.daemonParams), loggingManagerFactory); }
public void configure(ProviderConnectionParameters parameters) { LogLevel providerLogLevel = parameters.getVerboseLogging() ? LogLevel.DEBUG : LogLevel.INFO; LOGGER.debug("Configuring logging to level: {}", providerLogLevel); LoggingManagerInternal loggingManager = loggingServices.newInstance(LoggingManagerInternal.class); loggingManager.setLevel(providerLogLevel); loggingManager.start(); }
public DaemonRegistry getDaemonRegistry() { DaemonParameters parameters = new DaemonParameters(new BuildLayoutParameters()); parameters.setBaseDir(getDaemonBaseDir()); return new DaemonClientServices( LoggingServiceRegistry.newEmbeddableLogging(), parameters, new ByteArrayInputStream(new byte[0])) .get(DaemonRegistry.class); }
/** This is used by consumers 1.0-milestone-3 and later */ public DefaultConnection() { LOGGER.debug("Tooling API provider {} created.", GradleVersion.current().getVersion()); LoggingServiceRegistry loggingServices = LoggingServiceRegistry.newEmbeddableLogging(); services = ServiceRegistryBuilder.builder() .displayName("Connection services") .parent(loggingServices) .parent(NativeServices.getInstance()) .provider(new ConnectionScopeServices(loggingServices)) .build(); adapter = services.get(ProtocolToModelAdapter.class); connection = services.get(ProviderConnection.class); }
public ServiceRegistry createLoggingServices() { return LoggingServiceRegistry.newCommandLineProcessLogging(); }