diff options
Diffstat (limited to 'src/components/application_manager/src/app_launch/app_launch_data_json.cc')
-rw-r--r-- | src/components/application_manager/src/app_launch/app_launch_data_json.cc | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc index 86d585f215..d618e63e15 100644 --- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc +++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc @@ -38,7 +38,7 @@ namespace app_launch { -CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") +SDL_CREATE_LOG_VARIABLE("AppLaunch") AppLaunchDataJson::AppLaunchDataJson( const AppLaunchSettings& settings, @@ -50,16 +50,16 @@ AppLaunchDataJson::~AppLaunchDataJson() {} Json::Value& AppLaunchDataJson::GetSavedApplicationDataList( Json::Value& dictionary) const { using namespace application_manager; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(app_launch_json_lock_); Json::Value& app_launch = GetApplicationData(dictionary); if (!app_launch.isMember(strings::app_launch_list)) { app_launch[strings::app_launch_list] = Json::Value(Json::arrayValue); - LOG4CXX_WARN(logger_, "app_list section is missed"); + SDL_LOG_WARN("app_list section is missed"); } Json::Value& app_launch_list = app_launch[strings::app_launch_list]; if (!app_launch_list.isArray()) { - LOG4CXX_ERROR(logger_, "app_launch_list type INVALID rewrite"); + SDL_LOG_ERROR("app_launch_list type INVALID rewrite"); app_launch_list = Json::Value(Json::arrayValue); } return app_launch_list; @@ -68,15 +68,15 @@ Json::Value& AppLaunchDataJson::GetSavedApplicationDataList( Json::Value& AppLaunchDataJson::GetApplicationData( Json::Value& dictionary) const { using namespace application_manager; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(app_launch_json_lock_); if (!dictionary.isMember(strings::app_launch)) { dictionary[strings::app_launch] = Json::Value(Json::objectValue); - LOG4CXX_WARN(logger_, "app_launch section is missed"); + SDL_LOG_WARN("app_launch section is missed"); } Json::Value& app_launch = dictionary[strings::app_launch]; if (!app_launch.isObject()) { - LOG4CXX_ERROR(logger_, "resumption type INVALID rewrite"); + SDL_LOG_ERROR("resumption type INVALID rewrite"); app_launch = Json::Value(Json::objectValue); } return app_launch; @@ -87,7 +87,7 @@ Json::Value& AppLaunchDataJson::GetApplicationListAndIndex( int32_t& found_index, Json::Value& dictionary) const { using namespace application_manager; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(app_launch_json_lock_); Json::Value& apps_list = GetSavedApplicationDataList(dictionary); @@ -116,7 +116,7 @@ Json::Value& AppLaunchDataJson::GetApplicationListAndIndex( bool AppLaunchDataJson::IsAppDataAlreadyExisted( const ApplicationData& app_data) const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); int32_t index = NotFound; @@ -130,7 +130,7 @@ bool AppLaunchDataJson::IsAppDataAlreadyExisted( bool AppLaunchDataJson::RefreshAppSessionTime(const ApplicationData& app_data) { using namespace application_manager; using namespace date_time; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); bool retVal = false; int32_t index = NotFound; @@ -152,7 +152,7 @@ bool AppLaunchDataJson::RefreshAppSessionTime(const ApplicationData& app_data) { bool AppLaunchDataJson::AddNewAppData(const ApplicationData& app_data) { using namespace application_manager; using namespace date_time; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(app_launch_json_lock_); resumption::LastStateAccessor accessor = last_state_wrapper_->get_accessor(); @@ -166,18 +166,17 @@ bool AppLaunchDataJson::AddNewAppData(const ApplicationData& app_data) { static_cast<Json::Value::UInt64>(getSecs(getCurrentTime())); accessor.GetMutableData().set_dictionary(dictionary); - LOG4CXX_DEBUG(logger_, - "New application data saved. Detatils device_id: " - << app_data.device_mac_ - << ", app_id: " << app_data.mobile_app_id_ - << ", bundle_id: " << app_data.bundle_id_ << "."); + SDL_LOG_DEBUG("New application data saved. Detatils device_id: " + << app_data.device_mac_ + << ", app_id: " << app_data.mobile_app_id_ + << ", bundle_id: " << app_data.bundle_id_ << "."); return true; } std::vector<ApplicationDataPtr> AppLaunchDataJson::GetAppDataByDevMac( const std::string& dev_mac) const { using namespace application_manager; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(app_launch_json_lock_); std::vector<ApplicationDataPtr> dev_apps; resumption::LastStateAccessor accessor = last_state_wrapper_->get_accessor(); @@ -207,32 +206,30 @@ std::vector<ApplicationDataPtr> AppLaunchDataJson::GetAppDataByDevMac( } bool AppLaunchDataJson::Clear() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); resumption::LastStateAccessor accessor = last_state_wrapper_->get_accessor(); Json::Value dictionary = accessor.GetData().dictionary(); GetSavedApplicationDataList(dictionary).clear(); accessor.GetMutableData().set_dictionary(dictionary); - LOG4CXX_DEBUG(logger_, - "Application launch JSON section successfully cleared."); + SDL_LOG_DEBUG("Application launch JSON section successfully cleared."); return true; } uint32_t AppLaunchDataJson::GetCurentNumberOfAppData() const { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); resumption::LastStateAccessor accessor = last_state_wrapper_->get_accessor(); Json::Value dictionary = accessor.GetData().dictionary(); const uint32_t list_size = GetSavedApplicationDataList(dictionary).size(); accessor.GetMutableData().set_dictionary(dictionary); - LOG4CXX_DEBUG(logger_, - "Successfully was gotten app_launch list. Size: " << list_size); + SDL_LOG_DEBUG("Successfully was gotten app_launch list. Size: " << list_size); return list_size; } bool AppLaunchDataJson::DeleteOldestAppData() { using namespace application_manager; - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); sync_primitives::AutoLock autolock(app_launch_json_lock_); std::vector<uint64_t> temp_array; std::vector<Json::Value> temp_json_list; @@ -279,14 +276,14 @@ bool AppLaunchDataJson::DeleteOldestAppData() { GetSavedApplicationDataList(dictionary).append(item); } accessor.GetMutableData().set_dictionary(dictionary); - LOG4CXX_DEBUG( - logger_, "Oldest application launch data had been successfully deleted."); + SDL_LOG_DEBUG( + "Oldest application launch data had been successfully deleted."); return true; } bool AppLaunchDataJson::Persist() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); last_state_wrapper_->get_accessor().GetMutableData().SaveToFileSystem(); return true; } |