diff options
author | Scott Murray <scott.murray@konsulko.com> | 2019-10-07 17:04:44 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2019-10-15 11:33:31 -0400 |
commit | 54be328d031b3d8be799a2563d944e06c41c66ec (patch) | |
tree | f0e8b12ee562c5d5ba58326896c0062d34ab6a0b /src/plugins/utilities/logging | |
parent | 40a0b16e2e4e8b030473254c2f04b4b377bf76f1 (diff) |
Switch to appcontroller library
Remove old app-controller submodule usage in favor of library from the
toolchain. Also update dynamic API calls for V3.
Bug-AGL: SPEC-2856
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ida157480f95d0e8b0806a1d9af6cc396f4729850
(cherry picked from commit 0a7e93d37803ba31b18c7199cb1efc10ec83e0cc)
Diffstat (limited to 'src/plugins/utilities/logging')
-rw-r--r-- | src/plugins/utilities/logging/Logger.cpp | 15 | ||||
-rw-r--r-- | src/plugins/utilities/logging/Logger.h | 9 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/plugins/utilities/logging/Logger.cpp b/src/plugins/utilities/logging/Logger.cpp index b310695..e09ba9a 100644 --- a/src/plugins/utilities/logging/Logger.cpp +++ b/src/plugins/utilities/logging/Logger.cpp @@ -1,5 +1,6 @@ /* * Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2019 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -18,11 +19,11 @@ namespace utilities { namespace logging { // Constructor -Logger::Logger(AFB_ApiT api) { +Logger::Logger(afb_api_t api) { mApi = api; } -unique_ptr<Logger> Logger::create(AFB_ApiT api) { +unique_ptr<Logger> Logger::create(afb_api_t api) { auto logger = std::unique_ptr<Logger>(new Logger(api)); return logger; } @@ -31,19 +32,19 @@ void Logger::log(Level level, const std::string& tag, const std::string& message string format_msg = "Tag: " + tag + ", message: " + message; switch (level) { case Level::NOTICE: - AFB_ApiNotice(mApi, format_msg.c_str()); + AFB_API_NOTICE(mApi, format_msg.c_str()); break; case Level::WARNING: - AFB_ApiWarning(mApi, format_msg.c_str()); + AFB_API_WARNING(mApi, format_msg.c_str()); break; case Level::DEBUG: - AFB_ApiDebug(mApi, format_msg.c_str()); + AFB_API_DEBUG(mApi, format_msg.c_str()); break; case Level::ERROR: - AFB_ApiError(mApi, format_msg.c_str()); + AFB_API_ERROR(mApi, format_msg.c_str()); break; case Level::INFO: - AFB_ApiInfo(mApi, format_msg.c_str()); + AFB_API_INFO(mApi, format_msg.c_str()); break; default: break; diff --git a/src/plugins/utilities/logging/Logger.h b/src/plugins/utilities/logging/Logger.h index d1d0196..78a4a22 100644 --- a/src/plugins/utilities/logging/Logger.h +++ b/src/plugins/utilities/logging/Logger.h @@ -1,5 +1,6 @@ /* * Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2019 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. @@ -19,7 +20,7 @@ extern "C" { #define AFB_BINDING_VERSION 3 -#include "afb-definitions.h" +#include <afb/afb-binding.h> #include "ctl-plugin.h" }; @@ -32,17 +33,17 @@ namespace logging { class Logger : public vshlcore::common::interfaces::ILogger { public: - static std::unique_ptr<Logger> create(AFB_ApiT api); + static std::unique_ptr<Logger> create(afb_api_t api); // ILogger interface void log(Level level, const std::string &tag, const std::string &message) override; private: - Logger(AFB_ApiT api); + Logger(afb_api_t api); // Binding API reference - AFB_ApiT mApi; + afb_api_t mApi; }; } // namespace logging |