final BuildScopeServices serviceRegistry = new BuildScopeServices(sharedServices, startParameter);
serviceRegistry.add(BuildRequestMetaData.class, requestMetaData);
serviceRegistry.add(BuildClientMetaData.class, requestMetaData.getClient());
serviceRegistry.add(BuildCancellationToken.class, cancellationToken);
ListenerManager listenerManager = serviceRegistry.get(ListenerManager.class);
LoggingManagerInternal loggingManager = serviceRegistry.newInstance(LoggingManagerInternal.class);
loggingManager.setLevel(startParameter.getLogLevel());
//this hooks up the ListenerManager and LoggingConfigurer so you can call Gradle.addListener() with a StandardOutputListener.
loggingManager.addStandardOutputListener(listenerManager.getBroadcaster(StandardOutputListener.class));
loggingManager.addStandardErrorListener(listenerManager.getBroadcaster(StandardOutputListener.class));