Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

678: register Severity enum for reflection #679

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.quarkiverse.googlecloudservices.logging.deployment;

import java.util.ArrayList;
import java.util.List;

import io.quarkiverse.googlecloudservices.logging.runtime.LoggingConfiguration;
import io.quarkiverse.googlecloudservices.logging.runtime.TraceInfoExtractor;
import io.quarkiverse.googlecloudservices.logging.runtime.cdi.LoggingProducer;
Expand All @@ -11,6 +14,7 @@
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.LogHandlerBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;

public class LoggingBuildSteps {

Expand Down Expand Up @@ -38,4 +42,14 @@ public UnremovableBeanBuildItem helperClasses() {
public LogHandlerBuildItem handler(LoggingConfiguration config, LoggingHandlerFactory factory) {
return new LogHandlerBuildItem(factory.create(config));
}

@BuildStep
public List<ReflectiveClassBuildItem> registerReflectiveClasses() {
List<ReflectiveClassBuildItem> items = new ArrayList<>();
// Required for native builds as LoggingHandler uses Gson to serialize severity values
items.add(ReflectiveClassBuildItem.builder("com.google.cloud.logging.Severity")
.fields(true)
.build());
return items;
}
}
Loading