From 44b0b70fd8871da49b36763db62b0873f29a6a07 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Wed, 2 Jan 2019 18:09:28 +0700 Subject: [PATCH] Drop some log messages down to debug from info --- .../arc/deployment/ArcAnnotationProcessor.java | 4 ++-- .../shamrock/jpa/runtime/JPADeploymentTemplate.java | 2 +- .../restclient/runtime/RestClientBuilderImpl.java | 2 +- .../scheduler/deployment/SchedulerProcessor.java | 2 +- .../shamrock/scheduler/runtime/QuartzScheduler.java | 2 +- .../jboss/protean/arc/processor/BeanDeployment.java | 10 +++++----- .../org/jboss/protean/arc/processor/BeanGenerator.java | 3 +-- .../org/jboss/protean/arc/processor/BeanProcessor.java | 2 +- .../java/org/jboss/protean/arc/ArcContainerImpl.java | 4 ++-- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java b/extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java index bdec698b67b48..ef3c31ae05505 100644 --- a/extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java +++ b/extensions/arc/deployment/src/main/java/org/jboss/shamrock/arc/deployment/ArcAnnotationProcessor.java @@ -264,7 +264,7 @@ private void indexBeanClass(String beanClass, Indexer indexer, IndexView shamroc } ClassInfo beanInfo = shamrockIndex.getClassByName(beanClassName); if (beanInfo == null) { - log.infof("Index bean class: %s", beanClass); + log.debugf("Index bean class: %s", beanClass); try (InputStream stream = new ByteArrayInputStream(beanData)) { beanInfo = indexer.index(stream); additionalIndex.add(beanInfo.name()); @@ -279,7 +279,7 @@ private void indexBeanClass(String beanClass, Indexer indexer, IndexView shamroc if (!additionalIndex.contains(annotationName) && shamrockIndex.getClassByName(annotationName) == null) { try (InputStream annotationStream = ArcAnnotationProcessor.class.getClassLoader() .getResourceAsStream(annotationName.toString().replace('.', '/') + ".class")) { - log.infof("Index annotation: %s", annotationName); + log.debugf("Index annotation: %s", annotationName); indexer.index(annotationStream); additionalIndex.add(annotationName); } catch (IOException e) { diff --git a/extensions/jpa/runtime/src/main/java/org/jboss/shamrock/jpa/runtime/JPADeploymentTemplate.java b/extensions/jpa/runtime/src/main/java/org/jboss/shamrock/jpa/runtime/JPADeploymentTemplate.java index 886a52209160e..f8a750587f7f3 100644 --- a/extensions/jpa/runtime/src/main/java/org/jboss/shamrock/jpa/runtime/JPADeploymentTemplate.java +++ b/extensions/jpa/runtime/src/main/java/org/jboss/shamrock/jpa/runtime/JPADeploymentTemplate.java @@ -44,7 +44,7 @@ public void addEntity(String entityClass) { } public void enlistPersistenceUnit() { - Logger.getLogger("org.jboss.shamrock.jpa").infof("List of entities found by Shamrock deployment:%n%s", entities); + Logger.getLogger("org.jboss.shamrock.jpa").debugf("List of entities found by Shamrock deployment:%n%s", entities); } public void callHibernateFeatureInit() { diff --git a/extensions/rest-client/runtime/src/main/java/org/jboss/shamrock/restclient/runtime/RestClientBuilderImpl.java b/extensions/rest-client/runtime/src/main/java/org/jboss/shamrock/restclient/runtime/RestClientBuilderImpl.java index 40713bfa461ff..1e995861e538d 100644 --- a/extensions/rest-client/runtime/src/main/java/org/jboss/shamrock/restclient/runtime/RestClientBuilderImpl.java +++ b/extensions/rest-client/runtime/src/main/java/org/jboss/shamrock/restclient/runtime/RestClientBuilderImpl.java @@ -486,7 +486,7 @@ public Set getLocalProviderInstances() { public void registerLocalProviderInstance(Object provider, Map, Integer> contracts) { for (Object registered : getLocalProviderInstances()) { if (registered == provider) { - log.infof("Provider already registered: %s", provider.getClass()); + log.debugf("Provider already registered: %s", provider.getClass()); return; } } diff --git a/extensions/scheduler/deployment/src/main/java/org/jboss/shamrock/scheduler/deployment/SchedulerProcessor.java b/extensions/scheduler/deployment/src/main/java/org/jboss/shamrock/scheduler/deployment/SchedulerProcessor.java index 758c2d6afc471..c6d79ab185fe6 100644 --- a/extensions/scheduler/deployment/src/main/java/org/jboss/shamrock/scheduler/deployment/SchedulerProcessor.java +++ b/extensions/scheduler/deployment/src/main/java/org/jboss/shamrock/scheduler/deployment/SchedulerProcessor.java @@ -107,7 +107,7 @@ public void transform(TransformationContext context) { if (context.getAnnotations().isEmpty()) { // Class with no annotations but with @Scheduled method if (context.getTarget().asClass().annotations().containsKey(SCHEDULED_NAME) || context.getTarget().asClass().annotations().containsKey(SCHEDULEDS_NAME)) { - LOGGER.infof("Found scheduled business methods on a class %s with no annotations - adding @Singleton", context.getTarget()); + LOGGER.debugf("Found scheduled business methods on a class %s with no annotations - adding @Singleton", context.getTarget()); context.transform().add(Singleton.class).done(); } } diff --git a/extensions/scheduler/runtime/src/main/java/org/jboss/shamrock/scheduler/runtime/QuartzScheduler.java b/extensions/scheduler/runtime/src/main/java/org/jboss/shamrock/scheduler/runtime/QuartzScheduler.java index 63a4d3941443f..e720df151aa71 100644 --- a/extensions/scheduler/runtime/src/main/java/org/jboss/shamrock/scheduler/runtime/QuartzScheduler.java +++ b/extensions/scheduler/runtime/src/main/java/org/jboss/shamrock/scheduler/runtime/QuartzScheduler.java @@ -208,7 +208,7 @@ public Job newJob(TriggerFiredBundle bundle, org.quartz.Scheduler scheduler) thr triggerBuilder.startAt(new Date(Instant.now().plusMillis(scheduled.delayUnit().toMillis(scheduled.delay())).toEpochMilli())); } scheduler.scheduleJob(jobBuilder.build(), triggerBuilder.build()); - LOGGER.infof("Scheduled business method %s with config %s", schedulerConfig.getDescription(entry.getKey()), scheduled); + LOGGER.debugf("Scheduled business method %s with config %s", schedulerConfig.getDescription(entry.getKey()), scheduled); } } diff --git a/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanDeployment.java b/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanDeployment.java index ec739b9c91584..2741474d72409 100644 --- a/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanDeployment.java +++ b/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanDeployment.java @@ -263,7 +263,7 @@ void init() { for (InterceptorInfo interceptor : interceptors) { interceptor.init(); } - LOGGER.infof("Bean deployment initialized in %s ms", System.currentTimeMillis() - start); + LOGGER.debugf("Bean deployment initialized in %s ms", System.currentTimeMillis() - start); } static Map findQualifiers(IndexView index) { @@ -382,7 +382,7 @@ private List findBeans(Collection beanDefiningAnnotations, Li // Producers are not inherited producerMethods.add(method); if (!hasBeanDefiningAnnotation) { - LOGGER.infof("Producer method found but %s has no bean defining annotation - using @Dependent", beanClass); + LOGGER.debugf("Producer method found but %s has no bean defining annotation - using @Dependent", beanClass); beanClasses.add(beanClass); } } else if (annotationStore.hasAnnotation(method, DotNames.DISPOSES)) { @@ -392,14 +392,14 @@ private List findBeans(Collection beanDefiningAnnotations, Li // TODO observers are inherited syncObserverMethods.add(method); if (!hasBeanDefiningAnnotation) { - LOGGER.infof("Observer method found but %s has no bean defining annotation - using @Dependent", beanClass); + LOGGER.debugf("Observer method found but %s has no bean defining annotation - using @Dependent", beanClass); beanClasses.add(beanClass); } } else if (annotationStore.hasAnnotation(method, DotNames.OBSERVES_ASYNC)) { // TODO observers are inherited asyncObserverMethods.add(method); if (!hasBeanDefiningAnnotation) { - LOGGER.infof("Observer method found but %s has no bean defining annotation - using @Dependent", beanClass); + LOGGER.debugf("Observer method found but %s has no bean defining annotation - using @Dependent", beanClass); beanClasses.add(beanClass); } } @@ -409,7 +409,7 @@ private List findBeans(Collection beanDefiningAnnotations, Li // Producer fields are not inherited producerFields.add(field); if (!hasBeanDefiningAnnotation) { - LOGGER.infof("Producer field found but %s has no bean defining annotation - using @Dependent", beanClass); + LOGGER.debugf("Producer field found but %s has no bean defining annotation - using @Dependent", beanClass); beanClasses.add(beanClass); } } diff --git a/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanGenerator.java b/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanGenerator.java index cad808c72abb8..b3c61249b6b53 100644 --- a/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanGenerator.java +++ b/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanGenerator.java @@ -646,8 +646,7 @@ protected void implementDestroy(BeanInfo bean, ClassCreator beanCreator, String bean.getDeployment().getIndex()); for (MethodInfo callback : preDestroyCallbacks) { if (Modifier.isPrivate(callback.flags())) { - LOGGER.infof("PreDestroy callback %s#%s is private - users are encouraged to avoid using private callbacks", - callback.declaringClass().name(), callback.name()); + LOGGER.logf(isApplicationClass ? Level.INFO : Level.DEBUG, "PreDestroy callback %s#%s is private - users are encouraged to avoid using private callbacks", callback.declaringClass().name(), callback.name()); reflectionRegistration.registerMethod(callback); destroy.invokeStaticMethod(MethodDescriptors.REFLECTIONS_INVOKE_METHOD, destroy.loadClass(callback.declaringClass().name().toString()), destroy.load(callback.name()), destroy.newArray(Class.class, destroy.load(0)), destroy.getMethodParam(0), diff --git a/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanProcessor.java b/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanProcessor.java index 95d7368cc8698..986be49cbf0c4 100644 --- a/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanProcessor.java +++ b/independent-projects/arc/processor/src/main/java/org/jboss/protean/arc/processor/BeanProcessor.java @@ -215,7 +215,7 @@ public BeanDeployment process() throws IOException { for (Resource resource : resources) { output.writeResource(resource); } - LOGGER.infof("Generated %s resources in %s ms", resources.size(), System.currentTimeMillis() - start); + LOGGER.debugf("Generated %s resources in %s ms", resources.size(), System.currentTimeMillis() - start); return beanDeployment; } diff --git a/independent-projects/arc/runtime/src/main/java/org/jboss/protean/arc/ArcContainerImpl.java b/independent-projects/arc/runtime/src/main/java/org/jboss/protean/arc/ArcContainerImpl.java index 827a2fe728fc5..e87e9ed8752ce 100644 --- a/independent-projects/arc/runtime/src/main/java/org/jboss/protean/arc/ArcContainerImpl.java +++ b/independent-projects/arc/runtime/src/main/java/org/jboss/protean/arc/ArcContainerImpl.java @@ -106,7 +106,7 @@ void init() { EventImpl.createNotifier(Object.class, Object.class, qualifiers, this).notify(toString()); // Configure CDIProvider used for CDI.current() CDI.setCDIProvider(new ArcCDIProvider()); - LOGGER.infof("ArC DI container initialized [beans=%s, observers=%s]", beans.size(), observers.size()); + LOGGER.debugf("ArC DI container initialized [beans=%s, observers=%s]", beans.size(), observers.size()); } @Override @@ -254,7 +254,7 @@ void shutdown() { beans.clear(); resolved.clear(); observers.clear(); - LOGGER.infof("ArC DI container shut down"); + LOGGER.debugf("ArC DI container shut down"); } } }