in Gems/AWSMetrics/Code/Source/AWSMetricsSystemComponent.cpp [151:176]
void AWSMetricsSystemComponent::EnableOfflineRecording(const AZ::ConsoleCommandContainer& arguments)
{
if (arguments.size() == 0 || arguments.size() > 2)
{
AZ_Error("AWSMetrics", false, "Invalid number of console command arguments. Please provide a boolean value to enable/disable the feature. "
"To submit metrics recorded in the local file to the backend and delete the file, set the first argument to false and use \"submit\" as the second argument."
"For example, AWSMetricsSystemComponent.EnableOfflineRecording false submit");
return;
}
if (arguments[0] != "true" && arguments[0] != "false")
{
AZ_Error("AWSMetrics", false, "The first argument needs to be either true or false.");
return;
}
if (arguments.size() == 2 && arguments[1] != "submit")
{
AZ_Error("AWSMetrics", false, "The second argument needs to be \"submit\" if exists.");
return;
}
bool enable = arguments[0] == "true" ? true : false;
bool submitLocalMetrics = arguments.size() == 2;
m_metricsManager->UpdateOfflineRecordingStatus(enable, submitLocalMetrics);
}