Skip to content

Commit

Permalink
Merge pull request #405 from stuartwdouglas/reduce-logging
Browse files Browse the repository at this point in the history
Drop some log messages down to debug from info
  • Loading branch information
stuartwdouglas authored Jan 3, 2019
2 parents 6cb40d2 + 44b0b70 commit e9b8a3e
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public Set<Object> getLocalProviderInstances() {
public void registerLocalProviderInstance(Object provider, Map<Class<?>, 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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DotName, ClassInfo> findQualifiers(IndexView index) {
Expand Down Expand Up @@ -382,7 +382,7 @@ private List<BeanInfo> findBeans(Collection<DotName> 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)) {
Expand All @@ -392,14 +392,14 @@ private List<BeanInfo> findBeans(Collection<DotName> 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);
}
}
Expand All @@ -409,7 +409,7 @@ private List<BeanInfo> findBeans(Collection<DotName> 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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
}
}
}
Expand Down

0 comments on commit e9b8a3e

Please sign in to comment.