Skip to content

Commit

Permalink
change to jboss logger
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdaffurn committed Oct 9, 2024
1 parent b8b1b50 commit 5f0f0a3
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.logging.Logger;

import io.quarkus.agroal.spi.JdbcDataSourceBuildItem;
import io.quarkus.deployment.annotations.BuildProducer;
Expand All @@ -19,14 +18,14 @@

public class DatasourceProcessor {

private static final Logger log = LoggerFactory.getLogger(DatasourceProcessor.class);
private static final Logger log = Logger.getLogger(DatasourceProcessor.class);

@BuildStep
public SchemaContributorBuildItem registerDatasources(
List<JdbcDataSourceBuildItem> datasources,
BuildProducer<SystemPropertyBuildItem> systemPropProducer,
BuildProducer<GeneratedResourceBuildItem> generatedResourceBuildItemBuildProducer) {
log.info("Processing {} datasource annotations into decls", datasources.size());
log.infof("Processing %d datasource annotations into decls", datasources.size());
List<Decl> decls = new ArrayList<>();
List<String> namedDatasources = new ArrayList<>();
for (var ds : datasources) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;

import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.ClassInfo;
Expand All @@ -21,8 +20,7 @@
import org.jboss.jandex.FieldInfo;
import org.jboss.jandex.PrimitiveType;
import org.jboss.jandex.Type;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.logging.Logger;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
Expand All @@ -40,14 +38,14 @@

public class EnumProcessor {

private static final Logger log = LoggerFactory.getLogger(EnumProcessor.class);
private static final Logger log = Logger.getLogger(EnumProcessor.class);
public static final Set<PrimitiveType.Primitive> INT_TYPES = Set.of(INT, LONG, BYTE, SHORT);

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
SchemaContributorBuildItem handleEnums(CombinedIndexBuildItem index, FTLRecorder recorder) {
var enumAnnotations = index.getIndex().getAnnotations(FTLDotNames.ENUM);
log.info("Processing {} enum annotations into decls", enumAnnotations.size());
log.infof("Processing %d enum annotations into decls", enumAnnotations.size());
return new SchemaContributorBuildItem(moduleBuilder -> {
try {
var decls = extractEnumDecls(index, enumAnnotations, recorder, moduleBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import java.util.stream.Stream;

import org.eclipse.microprofile.config.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.logging.Logger;

import io.quarkus.bootstrap.prebuild.CodeGenException;
import io.quarkus.deployment.CodeGenContext;
Expand All @@ -29,7 +28,7 @@ public abstract class JVMCodeGenerator implements CodeGenProvider {

public static final String PACKAGE_PREFIX = "ftl.";
public static final String TYPE_MAPPER = "TypeAliasMapper";
private static final Logger log = LoggerFactory.getLogger(JVMCodeGenerator.class);
private static final Logger log = Logger.getLogger(JVMCodeGenerator.class);

@Override
public String providerId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
import java.util.stream.Collectors;

import org.jboss.jandex.DotName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.logging.Logger;
import org.tomlj.Toml;
import org.tomlj.TomlParseResult;

Expand Down Expand Up @@ -47,7 +46,7 @@

public class ModuleProcessor {

private static final Logger log = LoggerFactory.getLogger(ModuleProcessor.class);
private static final Logger log = Logger.getLogger(ModuleProcessor.class);

private static final String FEATURE = "ftl-java-runtime";

Expand Down Expand Up @@ -88,7 +87,7 @@ ModuleNameBuildItem moduleName(ApplicationInfoBuildItem applicationInfoBuildItem
if (value != null) {
return new ModuleNameBuildItem(value);
} else {
log.error("module name not found in {}", toml);
log.errorf("module name not found in %s", toml);
}
}
if (source.getParent() == null) {
Expand Down Expand Up @@ -123,7 +122,7 @@ public void generateSchema(CombinedIndexBuildItem index,
i.getSchemaContributor().accept(moduleBuilder);
}

log.info("Generating module '{}' schema from {} decls", moduleName, moduleBuilder.getDeclsCount());
log.infof("Generating module '%s' schema from %d decls", moduleName, moduleBuilder.getDeclsCount());
Path output = outputTargetBuildItem.getOutputDirectory().resolve(SCHEMA_OUT);
try (var out = Files.newOutputStream(output)) {
moduleBuilder.writeTo(out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.DotName;
import org.jboss.jandex.MethodInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.logging.Logger;

import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.deployment.annotations.BuildProducer;
Expand All @@ -25,14 +24,14 @@

public class SubscriptionProcessor {

private static final Logger log = LoggerFactory.getLogger(SubscriptionProcessor.class);
private static final Logger log = Logger.getLogger(SubscriptionProcessor.class);

@BuildStep
SubscriptionMetaAnnotationsBuildItem subscriptionAnnotations(CombinedIndexBuildItem combinedIndexBuildItem,
ModuleNameBuildItem moduleNameBuildItem) {
Collection<AnnotationInstance> subscriptionAnnotations = combinedIndexBuildItem.getComputingIndex()
.getAnnotations(Subscription.class);
log.info("Processing {} subscription annotations into decls", subscriptionAnnotations.size());
log.infof("Processing %s subscription annotations into decls", subscriptionAnnotations.size());
Map<DotName, SubscriptionMetaAnnotationsBuildItem.SubscriptionAnnotation> annotations = new HashMap<>();
for (var subscriptions : subscriptionAnnotations) {
if (subscriptions.target().kind() != AnnotationTarget.Kind.CLASS) {
Expand Down Expand Up @@ -65,7 +64,7 @@ public void registerSubscriptions(CombinedIndexBuildItem index,
for (var metaSub : subscriptionMetaAnnotationsBuildItem.getAnnotations().entrySet()) {
for (var subscription : index.getIndex().getAnnotations(metaSub.getKey())) {
if (subscription.target().kind() != AnnotationTarget.Kind.METHOD) {
log.warn("Subscription annotation on non-method target: {}", subscription.target());
log.warnf("Subscription annotation on non-method target: %s", subscription.target());
continue;
}
var method = subscription.target().asMethod();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import org.jboss.jandex.DotName;
import org.jboss.jandex.Type;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.logging.Logger;

import io.quarkus.deployment.GeneratedClassGizmoAdaptor;
import io.quarkus.deployment.annotations.BuildProducer;
Expand All @@ -27,12 +26,12 @@
public class TopicsProcessor {

public static final DotName TOPIC = DotName.createSimple(Topic.class);
private static final Logger log = LoggerFactory.getLogger(TopicsProcessor.class);
private static final Logger log = Logger.getLogger(TopicsProcessor.class);

@BuildStep
TopicsBuildItem handleTopics(CombinedIndexBuildItem index, BuildProducer<GeneratedClassBuildItem> generatedTopicProducer) {
var topicDefinitions = index.getComputingIndex().getAnnotations(TopicDefinition.class);
log.info("Processing {} topic definition annotations into decls", topicDefinitions.size());
log.infof("Processing %d topic definition annotations into decls", topicDefinitions.size());
Map<DotName, TopicsBuildItem.DiscoveredTopic> topics = new HashMap<>();
Set<String> names = new HashSet<>();
for (var topicDefinition : topicDefinitions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import org.jboss.jandex.AnnotationValue;
import org.jboss.jandex.Type;
import org.jboss.jandex.TypeVariable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.logging.Logger;

import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.deployment.annotations.BuildProducer;
Expand All @@ -18,15 +17,15 @@

public class TypeAliasProcessor {

private static final Logger log = LoggerFactory.getLogger(TypeAliasProcessor.class);
private static final Logger log = Logger.getLogger(TypeAliasProcessor.class);

@BuildStep
public void processTypeAlias(CombinedIndexBuildItem index,
BuildProducer<SchemaContributorBuildItem> schemaContributorBuildItemBuildProducer,
BuildProducer<AdditionalBeanBuildItem> additionalBeanBuildItem,
BuildProducer<TypeAliasBuildItem> typeAliasBuildItemBuildProducer) {
Collection<AnnotationInstance> typeAliasAnnotations = index.getIndex().getAnnotations(FTLDotNames.TYPE_ALIAS);
log.info("Processing {} type alias annotations into decls", typeAliasAnnotations.size());
log.infof("Processing %d type alias annotations into decls", typeAliasAnnotations.size());
var beans = new AdditionalBeanBuildItem.Builder().setUnremovable();
for (var mapper : typeAliasAnnotations) {
boolean exported = mapper.target().hasAnnotation(FTLDotNames.EXPORT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
import org.jboss.jandex.AnnotationValue;
import org.jboss.jandex.DotName;
import org.jboss.jandex.Type;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jboss.logging.Logger;

import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.arc.deployment.GeneratedBeanBuildItem;
Expand Down Expand Up @@ -43,15 +42,15 @@ public class VerbProcessor {
public static final DotName VERB_CLIENT_SOURCE = DotName.createSimple(VerbClientSource.class);
public static final DotName VERB_CLIENT_EMPTY = DotName.createSimple(VerbClientEmpty.class);
public static final String TEST_ANNOTATION = "xyz.block.ftl.java.test.FTLManaged";
private static final Logger log = LoggerFactory.getLogger(VerbProcessor.class);
private static final Logger log = Logger.getLogger(VerbProcessor.class);

@BuildStep
VerbClientBuildItem handleVerbClients(CombinedIndexBuildItem index, BuildProducer<GeneratedClassBuildItem> generatedClients,
BuildProducer<GeneratedBeanBuildItem> generatedBeanBuildItemBuildProducer,
ModuleNameBuildItem moduleNameBuildItem,
LaunchModeBuildItem launchModeBuildItem) {
var clientDefinitions = index.getComputingIndex().getAnnotations(VerbClientDefinition.class);
log.info("Processing {} verb clients", clientDefinitions.size());
log.infof("Processing %d verb clients", clientDefinitions.size());
Map<DotName, VerbClientBuildItem.DiscoveredClients> clients = new HashMap<>();
for (var clientDefinition : clientDefinitions) {
var iface = clientDefinition.target().asClass();
Expand Down Expand Up @@ -236,7 +235,7 @@ public void verbsAndCron(CombinedIndexBuildItem index,
List<TypeAliasBuildItem> typeAliasBuildItems // included to force typealias processing before this
) {
Collection<AnnotationInstance> verbAnnotations = index.getIndex().getAnnotations(FTLDotNames.VERB);
log.info("Processing {} verb annotations into decls", verbAnnotations.size());
log.infof("Processing %d verb annotations into decls", verbAnnotations.size());
var beans = AdditionalBeanBuildItem.builder().setUnremovable();
for (var verb : verbAnnotations) {
boolean exported = verb.target().hasAnnotation(FTLDotNames.EXPORT);
Expand All @@ -248,7 +247,7 @@ public void verbsAndCron(CombinedIndexBuildItem index,
}

Collection<AnnotationInstance> cronAnnotations = index.getIndex().getAnnotations(FTLDotNames.CRON);
log.info("Processing {} cron job annotations into decls", cronAnnotations.size());
log.infof("Processing %d cron job annotations into decls", cronAnnotations.size());
for (var cron : cronAnnotations) {
var method = cron.target().asMethod();
String className = method.declaringClass().name().toString();
Expand Down

0 comments on commit 5f0f0a3

Please sign in to comment.