diff --git a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java index 2b67625693..368c4ff01c 100644 --- a/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java +++ b/src/main/java/com/google/api/generator/spring/composer/SpringAutoConfigClassComposer.java @@ -386,24 +386,23 @@ private static MethodDefinition createCredentialsProviderBeanMethod( .setMethodName("hasKey") .setReturnType(TypeNode.BOOLEAN) .build(); + Statement logClientCredentials = + LoggerUtils.createLoggerStatement( + ValueExpr.withValue( + StringObjectValue.withValue( + "Using credentials from " + service.name() + "-specific configuration")), + types); IfStatement clientCredentialsIfStatement = createIfStatement( - clientPropertiesCredentialsHasKey, Arrays.asList(clientCredentialsReturnExpr), null); + clientPropertiesCredentialsHasKey, + Arrays.asList(logClientCredentials, clientCredentialsReturnExpr), + null); bodyStatements.add(clientCredentialsIfStatement); - - // @ConditionalOnMissingBean(name = "[serviceName]ServiceCredentials") - AnnotationNode conditionalOnMissingBeanExpr = - AnnotationNode.builder() - .setType(STATIC_TYPES.get("ConditionalOnMissingBean")) - .addDescription( - AssignmentExpr.builder() - .setVariableExpr( - VariableExpr.withVariable( - Variable.builder().setName("name").setType(TypeNode.STRING).build())) - .setValueExpr(ValueExpr.withValue(StringObjectValue.withValue(methodName))) - .build()) - .build(); - + bodyStatements.add( + LoggerUtils.createLoggerStatement( + ValueExpr.withValue( + StringObjectValue.withValue("Using credentials from global configuration")), + types)); return MethodDefinition.builder() .setName(methodName) .setHeaderCommentStatements( @@ -643,7 +642,7 @@ private static MethodDefinition createClientBeanMethod( .setArguments(getQuotaProjectId) .build(); - ExprStatement projectIdLoggerStatement = + Statement projectIdLoggerStatement = LoggerUtils.createLoggerStatement( LoggerUtils.concatManyWithExprs( ValueExpr.withValue(StringObjectValue.withValue("Quota project id set to ")), @@ -714,7 +713,7 @@ private static MethodDefinition createClientBeanMethod( .setArguments(executorProviderVarExpr) .build(); - ExprStatement backgroundExecutorLoggerStatement = + Statement backgroundExecutorLoggerStatement = LoggerUtils.createLoggerStatement( ArithmeticOperationExpr.concatWithExprs( ValueExpr.withValue( diff --git a/src/main/java/com/google/api/generator/spring/utils/LoggerUtils.java b/src/main/java/com/google/api/generator/spring/utils/LoggerUtils.java index ac888768a2..1a92319f5a 100644 --- a/src/main/java/com/google/api/generator/spring/utils/LoggerUtils.java +++ b/src/main/java/com/google/api/generator/spring/utils/LoggerUtils.java @@ -19,6 +19,7 @@ import com.google.api.generator.engine.ast.ConcreteReference; import com.google.api.generator.engine.ast.Expr; import com.google.api.generator.engine.ast.ExprStatement; +import com.google.api.generator.engine.ast.IfStatement; import com.google.api.generator.engine.ast.MethodInvocationExpr; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.ast.Statement; @@ -69,16 +70,24 @@ public static Statement getLoggerDeclarationExpr(String className, Map types) { + public static Statement createLoggerStatement(Expr value, Map types) { Variable loggerVariable = Variable.builder().setName("LOGGER").setType(STATIC_TYPES.get("Log")).build(); MethodInvocationExpr loggerCallExpr = MethodInvocationExpr.builder() .setExprReferenceExpr(VariableExpr.withVariable(loggerVariable)) - .setMethodName("info") + .setMethodName("trace") .setArguments(value) .build(); - return ExprStatement.withExpr(loggerCallExpr); + return IfStatement.builder() + .setConditionExpr( + MethodInvocationExpr.builder() + .setExprReferenceExpr(VariableExpr.withVariable(loggerVariable)) + .setMethodName("isTraceEnabled") + .setReturnType(TypeNode.BOOLEAN) + .build()) + .setBody(Arrays.asList(ExprStatement.withExpr(loggerCallExpr))) + .build(); } public static Expr concatManyWithExprs(Expr... exprs) { diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden index b973414fc1..f742818547 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationFull.golden @@ -82,8 +82,14 @@ public class EchoSpringAutoConfiguration { @ConditionalOnMissingBean public CredentialsProvider echoCredentials() throws IOException { if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from Echo-specific configuration"); + } return ((CredentialsProvider) new DefaultCredentialsProvider(this.clientProperties)); } + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from global configuration"); + } return ((CredentialsProvider) new DefaultCredentialsProvider(this.globalProperties)); } @@ -121,10 +127,12 @@ public class EchoSpringAutoConfiguration { .setHeaderProvider(this.userAgentHeaderProvider()); if (this.clientProperties.getQuotaProjectId() != null) { clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); - LOGGER.info( - "Quota project id set to " - + this.clientProperties.getQuotaProjectId() - + ", this overrides project id from credentials."); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); + } } if (this.clientProperties.getExecutorThreadCount() != null) { ExecutorProvider executorProvider = @@ -132,46 +140,65 @@ public class EchoSpringAutoConfiguration { .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) .build(); clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); - LOGGER.info( - "Background executor thread count is " + this.clientProperties.getExecutorThreadCount()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Background executor thread count is " + + this.clientProperties.getExecutorThreadCount()); + } } RetrySettings.Builder echoRetrySettingBuilder = clientSettingsBuilder.echoSettings().getRetrySettings().toBuilder(); if (this.clientProperties.getEchoInitialRetryDelay() != null) { echoRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getEchoInitialRetryDelay()); - LOGGER.info( - "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); + } } if (this.clientProperties.getEchoRetryDelayMultiplier() != null) { echoRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getEchoRetryDelayMultiplier()); - LOGGER.info( - "EchoRetryDelayMultiplier set to " + this.clientProperties.getEchoRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoRetryDelayMultiplier set to " + + this.clientProperties.getEchoRetryDelayMultiplier()); + } } if (this.clientProperties.getEchoMaxRetryDelay() != null) { echoRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getEchoMaxRetryDelay()); - LOGGER.info("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); + } } if (this.clientProperties.getEchoInitialRpcTimeout() != null) { echoRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getEchoInitialRpcTimeout()); - LOGGER.info( - "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); + } } if (this.clientProperties.getEchoRpcTimeoutMultiplier() != null) { echoRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getEchoRpcTimeoutMultiplier()); - LOGGER.info( - "EchoRpcTimeoutMultiplier set to " + this.clientProperties.getEchoRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoRpcTimeoutMultiplier set to " + + this.clientProperties.getEchoRpcTimeoutMultiplier()); + } } if (this.clientProperties.getEchoMaxRpcTimeout() != null) { echoRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getEchoMaxRpcTimeout()); - LOGGER.info("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); + } } if (this.clientProperties.getEchoTotalTimeout() != null) { echoRetrySettingBuilder.setTotalTimeout(this.clientProperties.getEchoTotalTimeout()); - LOGGER.info("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); + } } clientSettingsBuilder.echoSettings().setRetrySettings(echoRetrySettingBuilder.build()); RetrySettings.Builder expandRetrySettingBuilder = @@ -179,40 +206,56 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getExpandInitialRetryDelay() != null) { expandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getExpandInitialRetryDelay()); - LOGGER.info( - "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); + } } if (this.clientProperties.getExpandRetryDelayMultiplier() != null) { expandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getExpandRetryDelayMultiplier()); - LOGGER.info( - "ExpandRetryDelayMultiplier set to " - + this.clientProperties.getExpandRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandRetryDelayMultiplier set to " + + this.clientProperties.getExpandRetryDelayMultiplier()); + } } if (this.clientProperties.getExpandMaxRetryDelay() != null) { expandRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getExpandMaxRetryDelay()); - LOGGER.info("ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); + } } if (this.clientProperties.getExpandInitialRpcTimeout() != null) { expandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getExpandInitialRpcTimeout()); - LOGGER.info( - "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); + } } if (this.clientProperties.getExpandRpcTimeoutMultiplier() != null) { expandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getExpandRpcTimeoutMultiplier()); - LOGGER.info( - "ExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getExpandMaxRpcTimeout() != null) { expandRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getExpandMaxRpcTimeout()); - LOGGER.info("ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); + } } if (this.clientProperties.getExpandTotalTimeout() != null) { expandRetrySettingBuilder.setTotalTimeout(this.clientProperties.getExpandTotalTimeout()); - LOGGER.info("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); + } } clientSettingsBuilder.expandSettings().setRetrySettings(expandRetrySettingBuilder.build()); RetrySettings.Builder collectRetrySettingBuilder = @@ -220,23 +263,34 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollectInitialRpcTimeout() != null) { collectRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollectInitialRpcTimeout()); - LOGGER.info( - "CollectInitialRpcTimeout set to " + this.clientProperties.getCollectInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectInitialRpcTimeout set to " + + this.clientProperties.getCollectInitialRpcTimeout()); + } } if (this.clientProperties.getCollectRpcTimeoutMultiplier() != null) { collectRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollectRpcTimeoutMultiplier()); - LOGGER.info( - "CollectRpcTimeoutMultiplier set to " - + this.clientProperties.getCollectRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectRpcTimeoutMultiplier set to " + + this.clientProperties.getCollectRpcTimeoutMultiplier()); + } } if (this.clientProperties.getCollectMaxRpcTimeout() != null) { collectRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getCollectMaxRpcTimeout()); - LOGGER.info("CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); + } } if (this.clientProperties.getCollectTotalTimeout() != null) { collectRetrySettingBuilder.setTotalTimeout(this.clientProperties.getCollectTotalTimeout()); - LOGGER.info("CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); + } } clientSettingsBuilder.collectSettings().setRetrySettings(collectRetrySettingBuilder.build()); RetrySettings.Builder chatRetrySettingBuilder = @@ -244,22 +298,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatInitialRpcTimeout() != null) { chatRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatInitialRpcTimeout()); - LOGGER.info( - "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); + } } if (this.clientProperties.getChatRpcTimeoutMultiplier() != null) { chatRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatRpcTimeoutMultiplier()); - LOGGER.info( - "ChatRpcTimeoutMultiplier set to " + this.clientProperties.getChatRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatRpcTimeoutMultiplier set to " + + this.clientProperties.getChatRpcTimeoutMultiplier()); + } } if (this.clientProperties.getChatMaxRpcTimeout() != null) { chatRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getChatMaxRpcTimeout()); - LOGGER.info("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); + } } if (this.clientProperties.getChatTotalTimeout() != null) { chatRetrySettingBuilder.setTotalTimeout(this.clientProperties.getChatTotalTimeout()); - LOGGER.info("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); + } } clientSettingsBuilder.chatSettings().setRetrySettings(chatRetrySettingBuilder.build()); RetrySettings.Builder chatAgainRetrySettingBuilder = @@ -267,28 +330,36 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatAgainInitialRpcTimeout() != null) { chatAgainRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatAgainInitialRpcTimeout()); - LOGGER.info( - "ChatAgainInitialRpcTimeout set to " - + this.clientProperties.getChatAgainInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainInitialRpcTimeout set to " + + this.clientProperties.getChatAgainInitialRpcTimeout()); + } } if (this.clientProperties.getChatAgainRpcTimeoutMultiplier() != null) { chatAgainRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatAgainRpcTimeoutMultiplier()); - LOGGER.info( - "ChatAgainRpcTimeoutMultiplier set to " - + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainRpcTimeoutMultiplier set to " + + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + } } if (this.clientProperties.getChatAgainMaxRpcTimeout() != null) { chatAgainRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getChatAgainMaxRpcTimeout()); - LOGGER.info( - "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); + } } if (this.clientProperties.getChatAgainTotalTimeout() != null) { chatAgainRetrySettingBuilder.setTotalTimeout( this.clientProperties.getChatAgainTotalTimeout()); - LOGGER.info( - "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); + } } clientSettingsBuilder .chatAgainSettings() @@ -298,48 +369,64 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getPagedExpandInitialRetryDelay() != null) { pagedExpandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getPagedExpandInitialRetryDelay()); - LOGGER.info( - "PagedExpandInitialRetryDelay set to " - + this.clientProperties.getPagedExpandInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandInitialRetryDelay set to " + + this.clientProperties.getPagedExpandInitialRetryDelay()); + } } if (this.clientProperties.getPagedExpandRetryDelayMultiplier() != null) { pagedExpandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getPagedExpandRetryDelayMultiplier()); - LOGGER.info( - "PagedExpandRetryDelayMultiplier set to " - + this.clientProperties.getPagedExpandRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandRetryDelayMultiplier set to " + + this.clientProperties.getPagedExpandRetryDelayMultiplier()); + } } if (this.clientProperties.getPagedExpandMaxRetryDelay() != null) { pagedExpandRetrySettingBuilder.setMaxRetryDelay( this.clientProperties.getPagedExpandMaxRetryDelay()); - LOGGER.info( - "PagedExpandMaxRetryDelay set to " + this.clientProperties.getPagedExpandMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandMaxRetryDelay set to " + + this.clientProperties.getPagedExpandMaxRetryDelay()); + } } if (this.clientProperties.getPagedExpandInitialRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getPagedExpandInitialRpcTimeout()); - LOGGER.info( - "PagedExpandInitialRpcTimeout set to " - + this.clientProperties.getPagedExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandInitialRpcTimeout set to " + + this.clientProperties.getPagedExpandInitialRpcTimeout()); + } } if (this.clientProperties.getPagedExpandRpcTimeoutMultiplier() != null) { pagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); - LOGGER.info( - "PagedExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getPagedExpandMaxRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getPagedExpandMaxRpcTimeout()); - LOGGER.info( - "PagedExpandMaxRpcTimeout set to " + this.clientProperties.getPagedExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandMaxRpcTimeout set to " + + this.clientProperties.getPagedExpandMaxRpcTimeout()); + } } if (this.clientProperties.getPagedExpandTotalTimeout() != null) { pagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getPagedExpandTotalTimeout()); - LOGGER.info( - "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); + } } clientSettingsBuilder .pagedExpandSettings() @@ -349,30 +436,38 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getSimplePagedExpandInitialRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); - LOGGER.info( - "SimplePagedExpandInitialRpcTimeout set to " - + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandInitialRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + } } if (this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier() != null) { simplePagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); - LOGGER.info( - "SimplePagedExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getSimplePagedExpandMaxRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); - LOGGER.info( - "SimplePagedExpandMaxRpcTimeout set to " - + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandMaxRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + } } if (this.clientProperties.getSimplePagedExpandTotalTimeout() != null) { simplePagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getSimplePagedExpandTotalTimeout()); - LOGGER.info( - "SimplePagedExpandTotalTimeout set to " - + this.clientProperties.getSimplePagedExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandTotalTimeout set to " + + this.clientProperties.getSimplePagedExpandTotalTimeout()); + } } clientSettingsBuilder .simplePagedExpandSettings() @@ -382,22 +477,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getWaitInitialRpcTimeout() != null) { waitRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getWaitInitialRpcTimeout()); - LOGGER.info( - "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); + } } if (this.clientProperties.getWaitRpcTimeoutMultiplier() != null) { waitRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getWaitRpcTimeoutMultiplier()); - LOGGER.info( - "WaitRpcTimeoutMultiplier set to " + this.clientProperties.getWaitRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "WaitRpcTimeoutMultiplier set to " + + this.clientProperties.getWaitRpcTimeoutMultiplier()); + } } if (this.clientProperties.getWaitMaxRpcTimeout() != null) { waitRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getWaitMaxRpcTimeout()); - LOGGER.info("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); + } } if (this.clientProperties.getWaitTotalTimeout() != null) { waitRetrySettingBuilder.setTotalTimeout(this.clientProperties.getWaitTotalTimeout()); - LOGGER.info("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); + } } clientSettingsBuilder.waitSettings().setRetrySettings(waitRetrySettingBuilder.build()); RetrySettings.Builder blockRetrySettingBuilder = @@ -405,23 +509,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getBlockInitialRpcTimeout() != null) { blockRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getBlockInitialRpcTimeout()); - LOGGER.info( - "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); + } } if (this.clientProperties.getBlockRpcTimeoutMultiplier() != null) { blockRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getBlockRpcTimeoutMultiplier()); - LOGGER.info( - "BlockRpcTimeoutMultiplier set to " - + this.clientProperties.getBlockRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "BlockRpcTimeoutMultiplier set to " + + this.clientProperties.getBlockRpcTimeoutMultiplier()); + } } if (this.clientProperties.getBlockMaxRpcTimeout() != null) { blockRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getBlockMaxRpcTimeout()); - LOGGER.info("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); + } } if (this.clientProperties.getBlockTotalTimeout() != null) { blockRetrySettingBuilder.setTotalTimeout(this.clientProperties.getBlockTotalTimeout()); - LOGGER.info("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); + } } clientSettingsBuilder.blockSettings().setRetrySettings(blockRetrySettingBuilder.build()); RetrySettings.Builder collideNameRetrySettingBuilder = @@ -429,28 +541,37 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollideNameInitialRpcTimeout() != null) { collideNameRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollideNameInitialRpcTimeout()); - LOGGER.info( - "CollideNameInitialRpcTimeout set to " - + this.clientProperties.getCollideNameInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameInitialRpcTimeout set to " + + this.clientProperties.getCollideNameInitialRpcTimeout()); + } } if (this.clientProperties.getCollideNameRpcTimeoutMultiplier() != null) { collideNameRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollideNameRpcTimeoutMultiplier()); - LOGGER.info( - "CollideNameRpcTimeoutMultiplier set to " - + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameRpcTimeoutMultiplier set to " + + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + } } if (this.clientProperties.getCollideNameMaxRpcTimeout() != null) { collideNameRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getCollideNameMaxRpcTimeout()); - LOGGER.info( - "CollideNameMaxRpcTimeout set to " + this.clientProperties.getCollideNameMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameMaxRpcTimeout set to " + + this.clientProperties.getCollideNameMaxRpcTimeout()); + } } if (this.clientProperties.getCollideNameTotalTimeout() != null) { collideNameRetrySettingBuilder.setTotalTimeout( this.clientProperties.getCollideNameTotalTimeout()); - LOGGER.info( - "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); + } } clientSettingsBuilder .collideNameSettings() diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpc.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpc.golden index 4464a4ab01..70a77bff70 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpc.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpc.golden @@ -62,8 +62,14 @@ public class EchoSpringAutoConfiguration { @ConditionalOnMissingBean public CredentialsProvider echoCredentials() throws IOException { if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from Echo-specific configuration"); + } return ((CredentialsProvider) new DefaultCredentialsProvider(this.clientProperties)); } + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from global configuration"); + } return ((CredentialsProvider) new DefaultCredentialsProvider(this.globalProperties)); } @@ -101,10 +107,12 @@ public class EchoSpringAutoConfiguration { .setHeaderProvider(this.userAgentHeaderProvider()); if (this.clientProperties.getQuotaProjectId() != null) { clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); - LOGGER.info( - "Quota project id set to " - + this.clientProperties.getQuotaProjectId() - + ", this overrides project id from credentials."); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); + } } if (this.clientProperties.getExecutorThreadCount() != null) { ExecutorProvider executorProvider = @@ -112,46 +120,65 @@ public class EchoSpringAutoConfiguration { .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) .build(); clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); - LOGGER.info( - "Background executor thread count is " + this.clientProperties.getExecutorThreadCount()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Background executor thread count is " + + this.clientProperties.getExecutorThreadCount()); + } } RetrySettings.Builder echoRetrySettingBuilder = clientSettingsBuilder.echoSettings().getRetrySettings().toBuilder(); if (this.clientProperties.getEchoInitialRetryDelay() != null) { echoRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getEchoInitialRetryDelay()); - LOGGER.info( - "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); + } } if (this.clientProperties.getEchoRetryDelayMultiplier() != null) { echoRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getEchoRetryDelayMultiplier()); - LOGGER.info( - "EchoRetryDelayMultiplier set to " + this.clientProperties.getEchoRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoRetryDelayMultiplier set to " + + this.clientProperties.getEchoRetryDelayMultiplier()); + } } if (this.clientProperties.getEchoMaxRetryDelay() != null) { echoRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getEchoMaxRetryDelay()); - LOGGER.info("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); + } } if (this.clientProperties.getEchoInitialRpcTimeout() != null) { echoRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getEchoInitialRpcTimeout()); - LOGGER.info( - "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); + } } if (this.clientProperties.getEchoRpcTimeoutMultiplier() != null) { echoRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getEchoRpcTimeoutMultiplier()); - LOGGER.info( - "EchoRpcTimeoutMultiplier set to " + this.clientProperties.getEchoRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoRpcTimeoutMultiplier set to " + + this.clientProperties.getEchoRpcTimeoutMultiplier()); + } } if (this.clientProperties.getEchoMaxRpcTimeout() != null) { echoRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getEchoMaxRpcTimeout()); - LOGGER.info("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); + } } if (this.clientProperties.getEchoTotalTimeout() != null) { echoRetrySettingBuilder.setTotalTimeout(this.clientProperties.getEchoTotalTimeout()); - LOGGER.info("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); + } } clientSettingsBuilder.echoSettings().setRetrySettings(echoRetrySettingBuilder.build()); RetrySettings.Builder expandRetrySettingBuilder = @@ -159,40 +186,56 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getExpandInitialRetryDelay() != null) { expandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getExpandInitialRetryDelay()); - LOGGER.info( - "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); + } } if (this.clientProperties.getExpandRetryDelayMultiplier() != null) { expandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getExpandRetryDelayMultiplier()); - LOGGER.info( - "ExpandRetryDelayMultiplier set to " - + this.clientProperties.getExpandRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandRetryDelayMultiplier set to " + + this.clientProperties.getExpandRetryDelayMultiplier()); + } } if (this.clientProperties.getExpandMaxRetryDelay() != null) { expandRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getExpandMaxRetryDelay()); - LOGGER.info("ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); + } } if (this.clientProperties.getExpandInitialRpcTimeout() != null) { expandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getExpandInitialRpcTimeout()); - LOGGER.info( - "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); + } } if (this.clientProperties.getExpandRpcTimeoutMultiplier() != null) { expandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getExpandRpcTimeoutMultiplier()); - LOGGER.info( - "ExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getExpandMaxRpcTimeout() != null) { expandRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getExpandMaxRpcTimeout()); - LOGGER.info("ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); + } } if (this.clientProperties.getExpandTotalTimeout() != null) { expandRetrySettingBuilder.setTotalTimeout(this.clientProperties.getExpandTotalTimeout()); - LOGGER.info("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); + } } clientSettingsBuilder.expandSettings().setRetrySettings(expandRetrySettingBuilder.build()); RetrySettings.Builder collectRetrySettingBuilder = @@ -200,23 +243,34 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollectInitialRpcTimeout() != null) { collectRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollectInitialRpcTimeout()); - LOGGER.info( - "CollectInitialRpcTimeout set to " + this.clientProperties.getCollectInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectInitialRpcTimeout set to " + + this.clientProperties.getCollectInitialRpcTimeout()); + } } if (this.clientProperties.getCollectRpcTimeoutMultiplier() != null) { collectRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollectRpcTimeoutMultiplier()); - LOGGER.info( - "CollectRpcTimeoutMultiplier set to " - + this.clientProperties.getCollectRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectRpcTimeoutMultiplier set to " + + this.clientProperties.getCollectRpcTimeoutMultiplier()); + } } if (this.clientProperties.getCollectMaxRpcTimeout() != null) { collectRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getCollectMaxRpcTimeout()); - LOGGER.info("CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); + } } if (this.clientProperties.getCollectTotalTimeout() != null) { collectRetrySettingBuilder.setTotalTimeout(this.clientProperties.getCollectTotalTimeout()); - LOGGER.info("CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); + } } clientSettingsBuilder.collectSettings().setRetrySettings(collectRetrySettingBuilder.build()); RetrySettings.Builder chatRetrySettingBuilder = @@ -224,22 +278,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatInitialRpcTimeout() != null) { chatRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatInitialRpcTimeout()); - LOGGER.info( - "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); + } } if (this.clientProperties.getChatRpcTimeoutMultiplier() != null) { chatRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatRpcTimeoutMultiplier()); - LOGGER.info( - "ChatRpcTimeoutMultiplier set to " + this.clientProperties.getChatRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatRpcTimeoutMultiplier set to " + + this.clientProperties.getChatRpcTimeoutMultiplier()); + } } if (this.clientProperties.getChatMaxRpcTimeout() != null) { chatRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getChatMaxRpcTimeout()); - LOGGER.info("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); + } } if (this.clientProperties.getChatTotalTimeout() != null) { chatRetrySettingBuilder.setTotalTimeout(this.clientProperties.getChatTotalTimeout()); - LOGGER.info("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); + } } clientSettingsBuilder.chatSettings().setRetrySettings(chatRetrySettingBuilder.build()); RetrySettings.Builder chatAgainRetrySettingBuilder = @@ -247,28 +310,36 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatAgainInitialRpcTimeout() != null) { chatAgainRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatAgainInitialRpcTimeout()); - LOGGER.info( - "ChatAgainInitialRpcTimeout set to " - + this.clientProperties.getChatAgainInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainInitialRpcTimeout set to " + + this.clientProperties.getChatAgainInitialRpcTimeout()); + } } if (this.clientProperties.getChatAgainRpcTimeoutMultiplier() != null) { chatAgainRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatAgainRpcTimeoutMultiplier()); - LOGGER.info( - "ChatAgainRpcTimeoutMultiplier set to " - + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainRpcTimeoutMultiplier set to " + + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + } } if (this.clientProperties.getChatAgainMaxRpcTimeout() != null) { chatAgainRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getChatAgainMaxRpcTimeout()); - LOGGER.info( - "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); + } } if (this.clientProperties.getChatAgainTotalTimeout() != null) { chatAgainRetrySettingBuilder.setTotalTimeout( this.clientProperties.getChatAgainTotalTimeout()); - LOGGER.info( - "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); + } } clientSettingsBuilder .chatAgainSettings() @@ -278,48 +349,64 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getPagedExpandInitialRetryDelay() != null) { pagedExpandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getPagedExpandInitialRetryDelay()); - LOGGER.info( - "PagedExpandInitialRetryDelay set to " - + this.clientProperties.getPagedExpandInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandInitialRetryDelay set to " + + this.clientProperties.getPagedExpandInitialRetryDelay()); + } } if (this.clientProperties.getPagedExpandRetryDelayMultiplier() != null) { pagedExpandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getPagedExpandRetryDelayMultiplier()); - LOGGER.info( - "PagedExpandRetryDelayMultiplier set to " - + this.clientProperties.getPagedExpandRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandRetryDelayMultiplier set to " + + this.clientProperties.getPagedExpandRetryDelayMultiplier()); + } } if (this.clientProperties.getPagedExpandMaxRetryDelay() != null) { pagedExpandRetrySettingBuilder.setMaxRetryDelay( this.clientProperties.getPagedExpandMaxRetryDelay()); - LOGGER.info( - "PagedExpandMaxRetryDelay set to " + this.clientProperties.getPagedExpandMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandMaxRetryDelay set to " + + this.clientProperties.getPagedExpandMaxRetryDelay()); + } } if (this.clientProperties.getPagedExpandInitialRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getPagedExpandInitialRpcTimeout()); - LOGGER.info( - "PagedExpandInitialRpcTimeout set to " - + this.clientProperties.getPagedExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandInitialRpcTimeout set to " + + this.clientProperties.getPagedExpandInitialRpcTimeout()); + } } if (this.clientProperties.getPagedExpandRpcTimeoutMultiplier() != null) { pagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); - LOGGER.info( - "PagedExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getPagedExpandMaxRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getPagedExpandMaxRpcTimeout()); - LOGGER.info( - "PagedExpandMaxRpcTimeout set to " + this.clientProperties.getPagedExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandMaxRpcTimeout set to " + + this.clientProperties.getPagedExpandMaxRpcTimeout()); + } } if (this.clientProperties.getPagedExpandTotalTimeout() != null) { pagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getPagedExpandTotalTimeout()); - LOGGER.info( - "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); + } } clientSettingsBuilder .pagedExpandSettings() @@ -329,30 +416,38 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getSimplePagedExpandInitialRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); - LOGGER.info( - "SimplePagedExpandInitialRpcTimeout set to " - + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandInitialRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + } } if (this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier() != null) { simplePagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); - LOGGER.info( - "SimplePagedExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getSimplePagedExpandMaxRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); - LOGGER.info( - "SimplePagedExpandMaxRpcTimeout set to " - + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandMaxRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + } } if (this.clientProperties.getSimplePagedExpandTotalTimeout() != null) { simplePagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getSimplePagedExpandTotalTimeout()); - LOGGER.info( - "SimplePagedExpandTotalTimeout set to " - + this.clientProperties.getSimplePagedExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandTotalTimeout set to " + + this.clientProperties.getSimplePagedExpandTotalTimeout()); + } } clientSettingsBuilder .simplePagedExpandSettings() @@ -362,22 +457,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getWaitInitialRpcTimeout() != null) { waitRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getWaitInitialRpcTimeout()); - LOGGER.info( - "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); + } } if (this.clientProperties.getWaitRpcTimeoutMultiplier() != null) { waitRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getWaitRpcTimeoutMultiplier()); - LOGGER.info( - "WaitRpcTimeoutMultiplier set to " + this.clientProperties.getWaitRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "WaitRpcTimeoutMultiplier set to " + + this.clientProperties.getWaitRpcTimeoutMultiplier()); + } } if (this.clientProperties.getWaitMaxRpcTimeout() != null) { waitRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getWaitMaxRpcTimeout()); - LOGGER.info("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); + } } if (this.clientProperties.getWaitTotalTimeout() != null) { waitRetrySettingBuilder.setTotalTimeout(this.clientProperties.getWaitTotalTimeout()); - LOGGER.info("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); + } } clientSettingsBuilder.waitSettings().setRetrySettings(waitRetrySettingBuilder.build()); RetrySettings.Builder blockRetrySettingBuilder = @@ -385,23 +489,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getBlockInitialRpcTimeout() != null) { blockRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getBlockInitialRpcTimeout()); - LOGGER.info( - "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); + } } if (this.clientProperties.getBlockRpcTimeoutMultiplier() != null) { blockRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getBlockRpcTimeoutMultiplier()); - LOGGER.info( - "BlockRpcTimeoutMultiplier set to " - + this.clientProperties.getBlockRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "BlockRpcTimeoutMultiplier set to " + + this.clientProperties.getBlockRpcTimeoutMultiplier()); + } } if (this.clientProperties.getBlockMaxRpcTimeout() != null) { blockRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getBlockMaxRpcTimeout()); - LOGGER.info("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); + } } if (this.clientProperties.getBlockTotalTimeout() != null) { blockRetrySettingBuilder.setTotalTimeout(this.clientProperties.getBlockTotalTimeout()); - LOGGER.info("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); + } } clientSettingsBuilder.blockSettings().setRetrySettings(blockRetrySettingBuilder.build()); RetrySettings.Builder collideNameRetrySettingBuilder = @@ -409,28 +521,37 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollideNameInitialRpcTimeout() != null) { collideNameRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollideNameInitialRpcTimeout()); - LOGGER.info( - "CollideNameInitialRpcTimeout set to " - + this.clientProperties.getCollideNameInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameInitialRpcTimeout set to " + + this.clientProperties.getCollideNameInitialRpcTimeout()); + } } if (this.clientProperties.getCollideNameRpcTimeoutMultiplier() != null) { collideNameRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollideNameRpcTimeoutMultiplier()); - LOGGER.info( - "CollideNameRpcTimeoutMultiplier set to " - + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameRpcTimeoutMultiplier set to " + + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + } } if (this.clientProperties.getCollideNameMaxRpcTimeout() != null) { collideNameRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getCollideNameMaxRpcTimeout()); - LOGGER.info( - "CollideNameMaxRpcTimeout set to " + this.clientProperties.getCollideNameMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameMaxRpcTimeout set to " + + this.clientProperties.getCollideNameMaxRpcTimeout()); + } } if (this.clientProperties.getCollideNameTotalTimeout() != null) { collideNameRetrySettingBuilder.setTotalTimeout( this.clientProperties.getCollideNameTotalTimeout()); - LOGGER.info( - "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); + } } clientSettingsBuilder .collideNameSettings() diff --git a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpcRest.golden b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpcRest.golden index 9ce9e54996..a710b16903 100644 --- a/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpcRest.golden +++ b/src/test/java/com/google/api/generator/spring/composer/goldens/EchoSpringAutoConfigurationGrpcRest.golden @@ -63,8 +63,14 @@ public class EchoSpringAutoConfiguration { @ConditionalOnMissingBean public CredentialsProvider echoCredentials() throws IOException { if (this.clientProperties.getCredentials().hasKey()) { + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from Echo-specific configuration"); + } return ((CredentialsProvider) new DefaultCredentialsProvider(this.clientProperties)); } + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using credentials from global configuration"); + } return ((CredentialsProvider) new DefaultCredentialsProvider(this.globalProperties)); } @@ -102,10 +108,12 @@ public class EchoSpringAutoConfiguration { .setHeaderProvider(this.userAgentHeaderProvider()); if (this.clientProperties.getQuotaProjectId() != null) { clientSettingsBuilder.setQuotaProjectId(this.clientProperties.getQuotaProjectId()); - LOGGER.info( - "Quota project id set to " - + this.clientProperties.getQuotaProjectId() - + ", this overrides project id from credentials."); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Quota project id set to " + + this.clientProperties.getQuotaProjectId() + + ", this overrides project id from credentials."); + } } if (this.clientProperties.getExecutorThreadCount() != null) { ExecutorProvider executorProvider = @@ -113,51 +121,72 @@ public class EchoSpringAutoConfiguration { .setExecutorThreadCount(this.clientProperties.getExecutorThreadCount()) .build(); clientSettingsBuilder.setBackgroundExecutorProvider(executorProvider); - LOGGER.info( - "Background executor thread count is " + this.clientProperties.getExecutorThreadCount()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "Background executor thread count is " + + this.clientProperties.getExecutorThreadCount()); + } } if (this.clientProperties.getUseRest()) { clientSettingsBuilder.setTransportChannelProvider( EchoSettings.defaultHttpJsonTransportProviderBuilder().build()); - LOGGER.info("Using HTTP transport channel"); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("Using HTTP transport channel"); + } } RetrySettings.Builder echoRetrySettingBuilder = clientSettingsBuilder.echoSettings().getRetrySettings().toBuilder(); if (this.clientProperties.getEchoInitialRetryDelay() != null) { echoRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getEchoInitialRetryDelay()); - LOGGER.info( - "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoInitialRetryDelay set to " + this.clientProperties.getEchoInitialRetryDelay()); + } } if (this.clientProperties.getEchoRetryDelayMultiplier() != null) { echoRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getEchoRetryDelayMultiplier()); - LOGGER.info( - "EchoRetryDelayMultiplier set to " + this.clientProperties.getEchoRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoRetryDelayMultiplier set to " + + this.clientProperties.getEchoRetryDelayMultiplier()); + } } if (this.clientProperties.getEchoMaxRetryDelay() != null) { echoRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getEchoMaxRetryDelay()); - LOGGER.info("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoMaxRetryDelay set to " + this.clientProperties.getEchoMaxRetryDelay()); + } } if (this.clientProperties.getEchoInitialRpcTimeout() != null) { echoRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getEchoInitialRpcTimeout()); - LOGGER.info( - "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoInitialRpcTimeout set to " + this.clientProperties.getEchoInitialRpcTimeout()); + } } if (this.clientProperties.getEchoRpcTimeoutMultiplier() != null) { echoRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getEchoRpcTimeoutMultiplier()); - LOGGER.info( - "EchoRpcTimeoutMultiplier set to " + this.clientProperties.getEchoRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "EchoRpcTimeoutMultiplier set to " + + this.clientProperties.getEchoRpcTimeoutMultiplier()); + } } if (this.clientProperties.getEchoMaxRpcTimeout() != null) { echoRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getEchoMaxRpcTimeout()); - LOGGER.info("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoMaxRpcTimeout set to " + this.clientProperties.getEchoMaxRpcTimeout()); + } } if (this.clientProperties.getEchoTotalTimeout() != null) { echoRetrySettingBuilder.setTotalTimeout(this.clientProperties.getEchoTotalTimeout()); - LOGGER.info("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("EchoTotalTimeout set to " + this.clientProperties.getEchoTotalTimeout()); + } } clientSettingsBuilder.echoSettings().setRetrySettings(echoRetrySettingBuilder.build()); RetrySettings.Builder expandRetrySettingBuilder = @@ -165,40 +194,56 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getExpandInitialRetryDelay() != null) { expandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getExpandInitialRetryDelay()); - LOGGER.info( - "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandInitialRetryDelay set to " + this.clientProperties.getExpandInitialRetryDelay()); + } } if (this.clientProperties.getExpandRetryDelayMultiplier() != null) { expandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getExpandRetryDelayMultiplier()); - LOGGER.info( - "ExpandRetryDelayMultiplier set to " - + this.clientProperties.getExpandRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandRetryDelayMultiplier set to " + + this.clientProperties.getExpandRetryDelayMultiplier()); + } } if (this.clientProperties.getExpandMaxRetryDelay() != null) { expandRetrySettingBuilder.setMaxRetryDelay(this.clientProperties.getExpandMaxRetryDelay()); - LOGGER.info("ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandMaxRetryDelay set to " + this.clientProperties.getExpandMaxRetryDelay()); + } } if (this.clientProperties.getExpandInitialRpcTimeout() != null) { expandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getExpandInitialRpcTimeout()); - LOGGER.info( - "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandInitialRpcTimeout set to " + this.clientProperties.getExpandInitialRpcTimeout()); + } } if (this.clientProperties.getExpandRpcTimeoutMultiplier() != null) { expandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getExpandRpcTimeoutMultiplier()); - LOGGER.info( - "ExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getExpandMaxRpcTimeout() != null) { expandRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getExpandMaxRpcTimeout()); - LOGGER.info("ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ExpandMaxRpcTimeout set to " + this.clientProperties.getExpandMaxRpcTimeout()); + } } if (this.clientProperties.getExpandTotalTimeout() != null) { expandRetrySettingBuilder.setTotalTimeout(this.clientProperties.getExpandTotalTimeout()); - LOGGER.info("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ExpandTotalTimeout set to " + this.clientProperties.getExpandTotalTimeout()); + } } clientSettingsBuilder.expandSettings().setRetrySettings(expandRetrySettingBuilder.build()); RetrySettings.Builder collectRetrySettingBuilder = @@ -206,23 +251,34 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollectInitialRpcTimeout() != null) { collectRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollectInitialRpcTimeout()); - LOGGER.info( - "CollectInitialRpcTimeout set to " + this.clientProperties.getCollectInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectInitialRpcTimeout set to " + + this.clientProperties.getCollectInitialRpcTimeout()); + } } if (this.clientProperties.getCollectRpcTimeoutMultiplier() != null) { collectRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollectRpcTimeoutMultiplier()); - LOGGER.info( - "CollectRpcTimeoutMultiplier set to " - + this.clientProperties.getCollectRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectRpcTimeoutMultiplier set to " + + this.clientProperties.getCollectRpcTimeoutMultiplier()); + } } if (this.clientProperties.getCollectMaxRpcTimeout() != null) { collectRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getCollectMaxRpcTimeout()); - LOGGER.info("CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectMaxRpcTimeout set to " + this.clientProperties.getCollectMaxRpcTimeout()); + } } if (this.clientProperties.getCollectTotalTimeout() != null) { collectRetrySettingBuilder.setTotalTimeout(this.clientProperties.getCollectTotalTimeout()); - LOGGER.info("CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollectTotalTimeout set to " + this.clientProperties.getCollectTotalTimeout()); + } } clientSettingsBuilder.collectSettings().setRetrySettings(collectRetrySettingBuilder.build()); RetrySettings.Builder chatRetrySettingBuilder = @@ -230,22 +286,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatInitialRpcTimeout() != null) { chatRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatInitialRpcTimeout()); - LOGGER.info( - "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatInitialRpcTimeout set to " + this.clientProperties.getChatInitialRpcTimeout()); + } } if (this.clientProperties.getChatRpcTimeoutMultiplier() != null) { chatRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatRpcTimeoutMultiplier()); - LOGGER.info( - "ChatRpcTimeoutMultiplier set to " + this.clientProperties.getChatRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatRpcTimeoutMultiplier set to " + + this.clientProperties.getChatRpcTimeoutMultiplier()); + } } if (this.clientProperties.getChatMaxRpcTimeout() != null) { chatRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getChatMaxRpcTimeout()); - LOGGER.info("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ChatMaxRpcTimeout set to " + this.clientProperties.getChatMaxRpcTimeout()); + } } if (this.clientProperties.getChatTotalTimeout() != null) { chatRetrySettingBuilder.setTotalTimeout(this.clientProperties.getChatTotalTimeout()); - LOGGER.info("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("ChatTotalTimeout set to " + this.clientProperties.getChatTotalTimeout()); + } } clientSettingsBuilder.chatSettings().setRetrySettings(chatRetrySettingBuilder.build()); RetrySettings.Builder chatAgainRetrySettingBuilder = @@ -253,28 +318,36 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getChatAgainInitialRpcTimeout() != null) { chatAgainRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getChatAgainInitialRpcTimeout()); - LOGGER.info( - "ChatAgainInitialRpcTimeout set to " - + this.clientProperties.getChatAgainInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainInitialRpcTimeout set to " + + this.clientProperties.getChatAgainInitialRpcTimeout()); + } } if (this.clientProperties.getChatAgainRpcTimeoutMultiplier() != null) { chatAgainRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getChatAgainRpcTimeoutMultiplier()); - LOGGER.info( - "ChatAgainRpcTimeoutMultiplier set to " - + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainRpcTimeoutMultiplier set to " + + this.clientProperties.getChatAgainRpcTimeoutMultiplier()); + } } if (this.clientProperties.getChatAgainMaxRpcTimeout() != null) { chatAgainRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getChatAgainMaxRpcTimeout()); - LOGGER.info( - "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainMaxRpcTimeout set to " + this.clientProperties.getChatAgainMaxRpcTimeout()); + } } if (this.clientProperties.getChatAgainTotalTimeout() != null) { chatAgainRetrySettingBuilder.setTotalTimeout( this.clientProperties.getChatAgainTotalTimeout()); - LOGGER.info( - "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "ChatAgainTotalTimeout set to " + this.clientProperties.getChatAgainTotalTimeout()); + } } clientSettingsBuilder .chatAgainSettings() @@ -284,48 +357,64 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getPagedExpandInitialRetryDelay() != null) { pagedExpandRetrySettingBuilder.setInitialRetryDelay( this.clientProperties.getPagedExpandInitialRetryDelay()); - LOGGER.info( - "PagedExpandInitialRetryDelay set to " - + this.clientProperties.getPagedExpandInitialRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandInitialRetryDelay set to " + + this.clientProperties.getPagedExpandInitialRetryDelay()); + } } if (this.clientProperties.getPagedExpandRetryDelayMultiplier() != null) { pagedExpandRetrySettingBuilder.setRetryDelayMultiplier( this.clientProperties.getPagedExpandRetryDelayMultiplier()); - LOGGER.info( - "PagedExpandRetryDelayMultiplier set to " - + this.clientProperties.getPagedExpandRetryDelayMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandRetryDelayMultiplier set to " + + this.clientProperties.getPagedExpandRetryDelayMultiplier()); + } } if (this.clientProperties.getPagedExpandMaxRetryDelay() != null) { pagedExpandRetrySettingBuilder.setMaxRetryDelay( this.clientProperties.getPagedExpandMaxRetryDelay()); - LOGGER.info( - "PagedExpandMaxRetryDelay set to " + this.clientProperties.getPagedExpandMaxRetryDelay()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandMaxRetryDelay set to " + + this.clientProperties.getPagedExpandMaxRetryDelay()); + } } if (this.clientProperties.getPagedExpandInitialRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getPagedExpandInitialRpcTimeout()); - LOGGER.info( - "PagedExpandInitialRpcTimeout set to " - + this.clientProperties.getPagedExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandInitialRpcTimeout set to " + + this.clientProperties.getPagedExpandInitialRpcTimeout()); + } } if (this.clientProperties.getPagedExpandRpcTimeoutMultiplier() != null) { pagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); - LOGGER.info( - "PagedExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getPagedExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getPagedExpandMaxRpcTimeout() != null) { pagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getPagedExpandMaxRpcTimeout()); - LOGGER.info( - "PagedExpandMaxRpcTimeout set to " + this.clientProperties.getPagedExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandMaxRpcTimeout set to " + + this.clientProperties.getPagedExpandMaxRpcTimeout()); + } } if (this.clientProperties.getPagedExpandTotalTimeout() != null) { pagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getPagedExpandTotalTimeout()); - LOGGER.info( - "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "PagedExpandTotalTimeout set to " + this.clientProperties.getPagedExpandTotalTimeout()); + } } clientSettingsBuilder .pagedExpandSettings() @@ -335,30 +424,38 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getSimplePagedExpandInitialRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); - LOGGER.info( - "SimplePagedExpandInitialRpcTimeout set to " - + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandInitialRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandInitialRpcTimeout()); + } } if (this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier() != null) { simplePagedExpandRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); - LOGGER.info( - "SimplePagedExpandRpcTimeoutMultiplier set to " - + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandRpcTimeoutMultiplier set to " + + this.clientProperties.getSimplePagedExpandRpcTimeoutMultiplier()); + } } if (this.clientProperties.getSimplePagedExpandMaxRpcTimeout() != null) { simplePagedExpandRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); - LOGGER.info( - "SimplePagedExpandMaxRpcTimeout set to " - + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandMaxRpcTimeout set to " + + this.clientProperties.getSimplePagedExpandMaxRpcTimeout()); + } } if (this.clientProperties.getSimplePagedExpandTotalTimeout() != null) { simplePagedExpandRetrySettingBuilder.setTotalTimeout( this.clientProperties.getSimplePagedExpandTotalTimeout()); - LOGGER.info( - "SimplePagedExpandTotalTimeout set to " - + this.clientProperties.getSimplePagedExpandTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "SimplePagedExpandTotalTimeout set to " + + this.clientProperties.getSimplePagedExpandTotalTimeout()); + } } clientSettingsBuilder .simplePagedExpandSettings() @@ -368,22 +465,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getWaitInitialRpcTimeout() != null) { waitRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getWaitInitialRpcTimeout()); - LOGGER.info( - "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "WaitInitialRpcTimeout set to " + this.clientProperties.getWaitInitialRpcTimeout()); + } } if (this.clientProperties.getWaitRpcTimeoutMultiplier() != null) { waitRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getWaitRpcTimeoutMultiplier()); - LOGGER.info( - "WaitRpcTimeoutMultiplier set to " + this.clientProperties.getWaitRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "WaitRpcTimeoutMultiplier set to " + + this.clientProperties.getWaitRpcTimeoutMultiplier()); + } } if (this.clientProperties.getWaitMaxRpcTimeout() != null) { waitRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getWaitMaxRpcTimeout()); - LOGGER.info("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("WaitMaxRpcTimeout set to " + this.clientProperties.getWaitMaxRpcTimeout()); + } } if (this.clientProperties.getWaitTotalTimeout() != null) { waitRetrySettingBuilder.setTotalTimeout(this.clientProperties.getWaitTotalTimeout()); - LOGGER.info("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("WaitTotalTimeout set to " + this.clientProperties.getWaitTotalTimeout()); + } } clientSettingsBuilder.waitSettings().setRetrySettings(waitRetrySettingBuilder.build()); RetrySettings.Builder blockRetrySettingBuilder = @@ -391,23 +497,31 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getBlockInitialRpcTimeout() != null) { blockRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getBlockInitialRpcTimeout()); - LOGGER.info( - "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "BlockInitialRpcTimeout set to " + this.clientProperties.getBlockInitialRpcTimeout()); + } } if (this.clientProperties.getBlockRpcTimeoutMultiplier() != null) { blockRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getBlockRpcTimeoutMultiplier()); - LOGGER.info( - "BlockRpcTimeoutMultiplier set to " - + this.clientProperties.getBlockRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "BlockRpcTimeoutMultiplier set to " + + this.clientProperties.getBlockRpcTimeoutMultiplier()); + } } if (this.clientProperties.getBlockMaxRpcTimeout() != null) { blockRetrySettingBuilder.setMaxRpcTimeout(this.clientProperties.getBlockMaxRpcTimeout()); - LOGGER.info("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("BlockMaxRpcTimeout set to " + this.clientProperties.getBlockMaxRpcTimeout()); + } } if (this.clientProperties.getBlockTotalTimeout() != null) { blockRetrySettingBuilder.setTotalTimeout(this.clientProperties.getBlockTotalTimeout()); - LOGGER.info("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace("BlockTotalTimeout set to " + this.clientProperties.getBlockTotalTimeout()); + } } clientSettingsBuilder.blockSettings().setRetrySettings(blockRetrySettingBuilder.build()); RetrySettings.Builder collideNameRetrySettingBuilder = @@ -415,28 +529,37 @@ public class EchoSpringAutoConfiguration { if (this.clientProperties.getCollideNameInitialRpcTimeout() != null) { collideNameRetrySettingBuilder.setInitialRpcTimeout( this.clientProperties.getCollideNameInitialRpcTimeout()); - LOGGER.info( - "CollideNameInitialRpcTimeout set to " - + this.clientProperties.getCollideNameInitialRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameInitialRpcTimeout set to " + + this.clientProperties.getCollideNameInitialRpcTimeout()); + } } if (this.clientProperties.getCollideNameRpcTimeoutMultiplier() != null) { collideNameRetrySettingBuilder.setRpcTimeoutMultiplier( this.clientProperties.getCollideNameRpcTimeoutMultiplier()); - LOGGER.info( - "CollideNameRpcTimeoutMultiplier set to " - + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameRpcTimeoutMultiplier set to " + + this.clientProperties.getCollideNameRpcTimeoutMultiplier()); + } } if (this.clientProperties.getCollideNameMaxRpcTimeout() != null) { collideNameRetrySettingBuilder.setMaxRpcTimeout( this.clientProperties.getCollideNameMaxRpcTimeout()); - LOGGER.info( - "CollideNameMaxRpcTimeout set to " + this.clientProperties.getCollideNameMaxRpcTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameMaxRpcTimeout set to " + + this.clientProperties.getCollideNameMaxRpcTimeout()); + } } if (this.clientProperties.getCollideNameTotalTimeout() != null) { collideNameRetrySettingBuilder.setTotalTimeout( this.clientProperties.getCollideNameTotalTimeout()); - LOGGER.info( - "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); + if (LOGGER.isTraceEnabled()) { + LOGGER.trace( + "CollideNameTotalTimeout set to " + this.clientProperties.getCollideNameTotalTimeout()); + } } clientSettingsBuilder .collideNameSettings()