Skip to content

Commit

Permalink
style: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyTWF committed Apr 14, 2024
1 parent cd500c0 commit 5f00ef2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace UKControllerPlugin::Integration {

const auto metadata = nlohmann::json{
{"json_without_strict",
message->ToJson().dump(-1, ' ', false, nlohmann::json::error_handler_t::ignore)},
message->ToJson().dump(-1, ' ', false, nlohmann::json::error_handler_t::replace)},
{"exception", exception.what()}};

ApiLogger().Log("INTEGRATION_INVALID_JSON", "Failed to log integration message", metadata);
Expand Down
9 changes: 5 additions & 4 deletions src/utils/log/ApiLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ namespace UKControllerPluginUtils::Log {

struct ApiLogger::Impl
{
[[nodiscard]] auto
CreatePayloadNoMetadata(const std::string& type, const std::string& message) const -> nlohmann::json
[[nodiscard]]
auto CreatePayloadNoMetadata(const std::string& type, const std::string& message) const -> nlohmann::json
{
return {{"type", type}, {"message", message}, {"metadata", PluginVersionMetadata().dump()}};
}

[[nodiscard]] auto CreatePayload(
const std::string& type, const std::string& message, const nlohmann::json& metadata) const -> nlohmann::json
[[nodiscard]]
auto CreatePayload(const std::string& type, const std::string& message, const nlohmann::json& metadata) const
-> nlohmann::json
{
auto metadataWithVersion = PluginVersionMetadata();
metadataWithVersion.update(metadata);
Expand Down
4 changes: 2 additions & 2 deletions test/testingutils/test/ApiTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace UKControllerPluginTest {
[[nodiscard]] auto DontExpectApiRequest() -> std::shared_ptr<ApiMethodExpectation>;
void ExpectNoApiRequests();
void AwaitApiCallCompletion();
[[nodiscard]] auto
SettingsProvider() -> testing::NiceMock<UKControllerPluginUtilsTest::Api::MockApiSettingsProvider>&;
[[nodiscard]]
auto SettingsProvider() -> testing::NiceMock<UKControllerPluginUtilsTest::Api::MockApiSettingsProvider>&;

private:
std::shared_ptr<UKControllerPluginUtils::Api::ApiSettings> settings;
Expand Down

0 comments on commit 5f00ef2

Please sign in to comment.