Skip to content

Commit

Permalink
Clean up logs from processors
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdaffurn committed Oct 1, 2024
1 parent 085784d commit 15fc6b7
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public SchemaContributorBuildItem registerDatasources(
List<JdbcDataSourceBuildItem> datasources,
BuildProducer<SystemPropertyBuildItem> systemPropProducer,
BuildProducer<GeneratedResourceBuildItem> generatedResourceBuildItemBuildProducer) {
log.info("Processing {} datasource annotations into build items", datasources.size());
log.info("Processing {} 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 @@ -35,7 +35,7 @@ public class EnumProcessor {
@BuildStep
SchemaContributorBuildItem handleEnums(CombinedIndexBuildItem index) {
var enumAnnotations = index.getIndex().getAnnotations(FTLDotNames.ENUM);
log.info("Processing {} enum annotations into build items", enumAnnotations.size());
log.info("Processing {} enum annotations into decls", enumAnnotations.size());
List<Decl> decls = new ArrayList<>();
try {
// TODO how do we exclude @Enum annotations from generated verb clients?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ public ModuleBuilder addDecls(Decl decl) {
return this;
}

public int getDeclsCount() {
return decls.size();
}

public void writeTo(OutputStream out) throws IOException {
decls.values().stream().forEachOrdered(protoModuleBuilder::addDecls);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ public void generateSchema(CombinedIndexBuildItem index,
VerbClientBuildItem verbClientBuildItem,
List<SchemaContributorBuildItem> schemaContributorBuildItems) throws Exception {
String moduleName = moduleNameBuildItem.getModuleName();
log.info("Generating module '{}' schema from build items", moduleName);
Map<String, Iterable<String>> comments = readComments();

ModuleBuilder moduleBuilder = new ModuleBuilder(index.getComputingIndex(), moduleName, topicsBuildItem.getTopics(),
Expand All @@ -122,6 +121,7 @@ public void generateSchema(CombinedIndexBuildItem index,
i.getSchemaContributor().accept(moduleBuilder);
}

log.info("Generating module '{}' schema from {} 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 @@ -32,7 +32,7 @@ SubscriptionMetaAnnotationsBuildItem subscriptionAnnotations(CombinedIndexBuildI
ModuleNameBuildItem moduleNameBuildItem) {
Collection<AnnotationInstance> subscriptionAnnotations = combinedIndexBuildItem.getComputingIndex()
.getAnnotations(Subscription.class);
log.info("Processing {} subscription annotations into build items", subscriptionAnnotations.size());
log.info("Processing {} 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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class TopicsProcessor {
@BuildStep
TopicsBuildItem handleTopics(CombinedIndexBuildItem index, BuildProducer<GeneratedClassBuildItem> generatedTopicProducer) {
var topicDefinitions = index.getComputingIndex().getAnnotations(TopicDefinition.class);
log.info("Processing {} topic definition annotations into build items", topicDefinitions.size());
log.info("Processing {} 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 Expand Up @@ -86,7 +86,6 @@ TopicsBuildItem handleTopics(CombinedIndexBuildItem index, BuildProducer<Generat

@BuildStep
public SchemaContributorBuildItem topicSchema(TopicsBuildItem topics) {
log.info("Generating schema build items for {} topic build items", topics.getTopics().size());
//register all the topics we are defining in the module definition
return new SchemaContributorBuildItem(new Consumer<ModuleBuilder>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void processTypeAlias(CombinedIndexBuildItem index,
BuildProducer<AdditionalBeanBuildItem> additionalBeanBuildItem,
BuildProducer<TypeAliasBuildItem> typeAliasBuildItemBuildProducer) {
Collection<AnnotationInstance> typeAliasAnnotations = index.getIndex().getAnnotations(FTLDotNames.TYPE_ALIAS);
log.info("Processing {} type alias annotations into build items", typeAliasAnnotations.size());
log.info("Processing {} 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 @@ -233,7 +233,7 @@ public void verbsAndCron(CombinedIndexBuildItem index,
BuildProducer<AdditionalBeanBuildItem> additionalBeanBuildItem,
BuildProducer<SchemaContributorBuildItem> schemaContributorBuildItemBuildProducer) {
Collection<AnnotationInstance> verbAnnotations = index.getIndex().getAnnotations(FTLDotNames.VERB);
log.info("Processing {} verb annotations into schema build items", verbAnnotations.size());
log.info("Processing {} verb annotations into decls", verbAnnotations.size());
var beans = AdditionalBeanBuildItem.builder().setUnremovable();
for (var verb : verbAnnotations) {
boolean exported = verb.target().hasAnnotation(FTLDotNames.EXPORT);
Expand All @@ -245,7 +245,7 @@ public void verbsAndCron(CombinedIndexBuildItem index,
}

Collection<AnnotationInstance> cronAnnotations = index.getIndex().getAnnotations(FTLDotNames.CRON);
log.info("Processing {} cron job annotations into schema build items", cronAnnotations.size());
log.info("Processing {} 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 15fc6b7

Please sign in to comment.