Skip to content

Commit

Permalink
Add an SdkHarnessOption that controls whether logging is redirected t…
Browse files Browse the repository at this point in the history
…hrough the FnApi logging service. Redirection through the FnApi is enabled by default.
  • Loading branch information
t2h6 authored Dec 19, 2024
1 parent 85450f4 commit 6a3274f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ enum LogLevel {

void setLogMdc(boolean value);

/** This option controls whether logging will be redirected through the logging service. */
@Description("Controls whether logging will be redirected through the logging service.")
/** This option controls whether logging will be redirected through the FnApi. */
@Description("Controls whether logging will be redirected through the FnApi.")
@Default.Boolean(true)
boolean getEnableLoggingService();
boolean getEnableLogViaFnApi();

void setEnableLoggingService(boolean enableLoggingService);
void setEnableLogViaFnApi(boolean enableLogViaFnApi);

/**
* Size (in MB) of each grouping table used to pre-combine elements. Larger values may reduce the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static LoggingClient createAndStart(
PipelineOptions options,
Endpoints.ApiServiceDescriptor apiServiceDescriptor,
Function<Endpoints.ApiServiceDescriptor, ManagedChannel> channelFactory) {
if (options.as(SdkHarnessOptions.class).getEnableLoggingService()) {
if (options.as(SdkHarnessOptions.class).getEnableLogViaFnApi()) {
return BeamFnLoggingClient.createAndStart(options, apiServiceDescriptor, channelFactory);
} else {
return new NoOpLoggingClient();
Expand Down

0 comments on commit 6a3274f

Please sign in to comment.