Skip to content

Commit

Permalink
fix: remove logging from default UDF
Browse files Browse the repository at this point in the history
UDF logging message should be PS_VLOG(1) for now

Bug: 389938083
Change-Id: I95fd74a7348abd585f820eabcbf3e5a7dd75bece
GitOrigin-RevId: a12c16ed6a61ad9187afc3e9a6c9fee7abd99623
  • Loading branch information
lusayaa authored and copybara-github committed Jan 14, 2025
1 parent 91e479b commit 94a35e2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/udf/hooks/logging_hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ inline void LogMessage(
return;
}
PS_VLOG(10, request_context->GetPSLogContext()) << "Called logging hook";
PS_LOG(INFO, request_context->GetPSLogContext())
PS_VLOG(1, request_context->GetPSLogContext())
<< payload.io_proto.input_string();
}

Expand Down
1 change: 1 addition & 0 deletions components/udf/udf_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ absl::StatusOr<std::unique_ptr<UdfClient>> CreateUdfClient() {
class UdfClientTest : public ::testing::Test {
protected:
UdfClientTest() {
privacy_sandbox::server_common::log::SetGlobalPSVLogLevel(1);
privacy_sandbox::server_common::log::ServerToken(
kExampleConsentedDebugToken);
const std::string telemetry_config_str = R"pb(
Expand Down
4 changes: 0 additions & 4 deletions public/udf/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function handlePas(udf_arguments) {
if (udf_arguments.length != 1) {
const error_message =
'For PAS default UDF exactly one argument should be provided, but was provided ' + udf_arguments.length;
logMessage(error_message);
throw new Error(error_message);
}
const kv_result = JSON.parse(getValues(udf_arguments[0]));
Expand All @@ -63,7 +62,6 @@ function handlePas(udf_arguments) {
}
const error_message = "Error executing handle PAS:" +
JSON.stringify(kv_result);
logMessage(error_message);
throw new Error(error_message);
}
Expand All @@ -73,10 +71,8 @@ function handlePA(udf_arguments) {
}
function HandleRequest(executionMetadata, ...udf_arguments) {
logMessage("Executing UDF");
if(executionMetadata.requestMetadata &&
executionMetadata.requestMetadata.is_pas) {
logMessage('Executing PAS branch');
return handlePas(udf_arguments);
}
return handlePA(udf_arguments);
Expand Down

0 comments on commit 94a35e2

Please sign in to comment.