Skip to content

Commit

Permalink
fixup! SILKit-1607: Usage of key values for created participant and c…
Browse files Browse the repository at this point in the history
…ontroller types
  • Loading branch information
VLukasBecker committed Nov 6, 2024
1 parent fe96fbb commit 53460c5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions SilKit/source/core/participant/Participant_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,8 @@ auto Participant<SilKitConnectionT>::CreateRpcClient(
// RpcClient gets discovered by RpcServer which creates RpcServerInternal on a matching connection
Core::SupplementalData supplementalData;
supplementalData[SilKit::Core::Discovery::controllerType] = SilKit::Core::Discovery::controllerTypeRpcClient;
supplementalData[SilKit::Core::Discovery::supplKeyRpcClientFunctionName] = controllerConfig.functionName.value();
supplementalData[SilKit::Core::Discovery::supplKeyRpcClientMediaType] = dataSpec.MediaType();
supplementalData[SilKit::Core::Discovery::supplKeyRpcClientFunctionName] = configuredRpcSpec.FunctionName();
supplementalData[SilKit::Core::Discovery::supplKeyRpcClientMediaType] = configuredRpcSpec.MediaType();
supplementalData[SilKit::Core::Discovery::supplKeyRpcClientLabels] =
SilKit::Config::Serialize(configuredRpcSpec.Labels());
supplementalData[SilKit::Core::Discovery::supplKeyRpcClientUUID] = network;
Expand Down Expand Up @@ -784,8 +784,8 @@ auto Participant<SilKitConnectionT>::CreateRpcServer(
Core::SupplementalData supplementalData;
supplementalData[SilKit::Core::Discovery::controllerType] = SilKit::Core::Discovery::controllerTypeRpcServer;
// Needed for RpcServer discovery in tests
supplementalData[SilKit::Core::Discovery::supplKeyRpcServerFunctionName] = controllerConfig.functionName.value();
supplementalData[SilKit::Core::Discovery::supplKeyRpcServerMediaType] = dataSpec.MediaType();
supplementalData[SilKit::Core::Discovery::supplKeyRpcServerFunctionName] = configuredRpcSpec.FunctionName();
supplementalData[SilKit::Core::Discovery::supplKeyRpcServerMediaType] = configuredRpcSpec.MediaType();
supplementalData[SilKit::Core::Discovery::supplKeyRpcServerLabels] =
SilKit::Config::Serialize(configuredRpcSpec.Labels());

Expand All @@ -797,12 +797,16 @@ auto Participant<SilKitConnectionT>::CreateRpcServer(

if (GetLogger()->GetLogLevel() <= Logging::Level::Trace)
{
Logging::Trace(
GetLogger(),
"Created RPC Server '{}' with function name '{}' and media type '{}' for network '{}' with service name "
"'{}' and labels: {}",
controllerConfig.name, controllerConfig.functionName.value(), dataSpec.MediaType(), network,
controller->GetServiceDescriptor().to_string(), FormatLabelsForLogging(dataSpec.Labels()));
Logging::LoggerMessage lm{_logger.get(), Logging::Level::Trace};
lm.SetMessage("Created controller");
lm.SetKeyValue(Logging::Keys::controllerType, supplementalData[SilKit::Core::Discovery::controllerType]);
lm.SetKeyValue(Logging::Keys::controllerName, controllerConfig.name);
lm.SetKeyValue(Logging::Keys::controllerFuncName, controllerConfig.functionName.value());
lm.SetKeyValue(Logging::Keys::mediaType, dataSpec.MediaType());
lm.SetKeyValue(Logging::Keys::network, network);
lm.SetKeyValue(Logging::Keys::serviceName, controller->GetServiceDescriptor().to_string());
lm.SetKeyValue(Logging::Keys::label, FormatLabelsForLogging(dataSpec.Labels()));
lm.Dispatch();
}

return controller;
Expand Down

0 comments on commit 53460c5

Please sign in to comment.