From 3e0037be4056813787ec7e2a223a5f2418b738ac Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Thu, 2 Jun 2016 14:55:26 +0200 Subject: [PATCH] STEP_NAME marco Adding marco to print name of step that failed in AppInstaller class Following must be submitted together: - https://review.tizen.org/gerrit/72827 - https://review.tizen.org/gerrit/72828 - https://review.tizen.org/gerrit/72829 Change-Id: I6dcaa9b797836b3e6adde082513aba240fa1040b --- src/common/app_installer.cc | 15 ++++++++++++--- src/common/step/backup/step_backup_icons.h | 2 +- src/common/step/backup/step_backup_manifest.h | 2 +- src/common/step/backup/step_copy_backup.h | 2 +- src/common/step/configuration/step_block_cross_update.h | 2 +- src/common/step/configuration/step_check_tizen_version.h | 2 +- src/common/step/configuration/step_configure.h | 2 +- src/common/step/configuration/step_fail.h | 2 +- src/common/step/configuration/step_parse_manifest.h | 2 +- .../step/filesystem/step_acquire_external_storage.h | 2 +- src/common/step/filesystem/step_clear_data.h | 2 +- src/common/step/filesystem/step_copy.h | 2 +- .../step/filesystem/step_copy_storage_directories.h | 2 +- src/common/step/filesystem/step_copy_tep.h | 2 +- src/common/step/filesystem/step_create_icons.h | 2 +- .../filesystem/step_create_per_user_storage_directories.h | 2 +- .../step/filesystem/step_create_storage_directories.h | 2 +- src/common/step/filesystem/step_delta_patch.h | 2 +- .../step/filesystem/step_recover_external_storage.h | 2 +- src/common/step/filesystem/step_recover_files.h | 2 +- src/common/step/filesystem/step_recover_icons.h | 2 +- src/common/step/filesystem/step_recover_manifest.h | 2 +- .../step/filesystem/step_recover_storage_directories.h | 2 +- src/common/step/filesystem/step_remove_files.h | 2 +- src/common/step/filesystem/step_remove_icons.h | 2 +- .../filesystem/step_remove_per_user_storage_directories.h | 2 +- .../step/filesystem/step_remove_temporary_directory.h | 2 +- src/common/step/filesystem/step_remove_zip_image.h | 2 +- src/common/step/filesystem/step_unzip.h | 2 +- src/common/step/mount/step_mount_install.h | 2 +- src/common/step/mount/step_mount_unpacked.h | 2 +- src/common/step/mount/step_mount_update.h | 2 +- src/common/step/pkgmgr/step_check_removable.h | 2 +- src/common/step/pkgmgr/step_kill_apps.h | 2 +- src/common/step/pkgmgr/step_recover_application.h | 2 +- src/common/step/pkgmgr/step_register_app.h | 2 +- src/common/step/pkgmgr/step_remove_manifest.h | 2 +- src/common/step/pkgmgr/step_run_parser_plugins.h | 2 +- src/common/step/pkgmgr/step_unregister_app.h | 2 +- src/common/step/pkgmgr/step_update_app.h | 2 +- src/common/step/pkgmgr/step_update_tep.h | 2 +- src/common/step/rds/step_rds_parse.h | 2 ++ src/common/step/recovery/step_open_recovery_file.h | 2 +- src/common/step/security/step_check_background_category.h | 2 +- src/common/step/security/step_check_old_certificate.h | 2 +- src/common/step/security/step_check_signature.h | 2 +- src/common/step/security/step_privilege_compatibility.h | 2 +- src/common/step/security/step_recover_security.h | 2 +- src/common/step/security/step_register_security.h | 2 +- src/common/step/security/step_revoke_security.h | 2 +- .../step/security/step_rollback_deinstallation_security.h | 2 +- .../step/security/step_rollback_installation_security.h | 2 +- src/common/step/security/step_update_security.h | 2 +- src/common/step/step.h | 8 ++++++++ 54 files changed, 73 insertions(+), 54 deletions(-) diff --git a/src/common/app_installer.cc b/src/common/app_installer.cc index 5d58c66..ec5f84d 100644 --- a/src/common/app_installer.cc +++ b/src/common/app_installer.cc @@ -48,11 +48,18 @@ AppInstaller::Result AppInstaller::Run() { for (; it != itEnd; ++it, ++current_step) { try { process_status = (*it)->precheck(); + } catch (const std::exception& err) { + LOG(ERROR) << "Exception occurred in precheck(): " << err.what() + << " in step: " << (*it)->name(); + process_status = Step::Status::ERROR; + } + try { if (process_status == Step::Status::OK) { process_status = (*it)->process(); } } catch (const std::exception& err) { - LOG(ERROR) << "Exception occurred in process(): " << err.what(); + LOG(ERROR) << "Exception occurred in process(): " << err.what() + << " in step: " << (*it)->name(); process_status = Step::Status::ERROR; } @@ -86,7 +93,8 @@ AppInstaller::Result AppInstaller::Run() { ret = Result::UNDO_ERROR; } } catch (const std::exception& err) { - LOG(ERROR) << "Exception occurred in undo(): " << err.what(); + LOG(ERROR) << "Exception occurred in undo(): " << err.what() + << " in step: " << (*it)->name(); ret = Result::UNDO_ERROR; } } while (it-- != itStart); @@ -99,7 +107,8 @@ AppInstaller::Result AppInstaller::Run() { break; } } catch (const std::exception& err) { - LOG(ERROR) << "Exception occurred in clean(): " << err.what(); + LOG(ERROR) << "Exception occurred in clean(): " << err.what() + << " in step: " << step->name(); ret = Result::CLEANUP_ERROR; break; } diff --git a/src/common/step/backup/step_backup_icons.h b/src/common/step/backup/step_backup_icons.h index 843c916..80e36f5 100644 --- a/src/common/step/backup/step_backup_icons.h +++ b/src/common/step/backup/step_backup_icons.h @@ -53,7 +53,7 @@ class StepBackupIcons : public Step { std::vector> icons_; - SCOPE_LOG_TAG(BackupIcons) + STEP_NAME(BackupIcons) }; } // namespace backup diff --git a/src/common/step/backup/step_backup_manifest.h b/src/common/step/backup/step_backup_manifest.h index 59980a2..bafceb6 100644 --- a/src/common/step/backup/step_backup_manifest.h +++ b/src/common/step/backup/step_backup_manifest.h @@ -44,7 +44,7 @@ class StepBackupManifest : public Step { Status precheck() override; - SCOPE_LOG_TAG(BackupManifest) + STEP_NAME(BackupManifest) }; } // namespace backup diff --git a/src/common/step/backup/step_copy_backup.h b/src/common/step/backup/step_copy_backup.h index fea81c0..a4ed590 100644 --- a/src/common/step/backup/step_copy_backup.h +++ b/src/common/step/backup/step_copy_backup.h @@ -63,7 +63,7 @@ class StepCopyBackup : public Step { boost::filesystem::path install_path_; boost::filesystem::path backup_path_; - SCOPE_LOG_TAG(CopyBackup) + STEP_NAME(CopyBackup) }; } // namespace backup diff --git a/src/common/step/configuration/step_block_cross_update.h b/src/common/step/configuration/step_block_cross_update.h index cc32e8d..147b562 100644 --- a/src/common/step/configuration/step_block_cross_update.h +++ b/src/common/step/configuration/step_block_cross_update.h @@ -35,7 +35,7 @@ class StepBlockCrossUpdate : public Step { Status undo() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(BlockCrossUpdate) + STEP_NAME(BlockCrossUpdate) }; } // namespace configuration diff --git a/src/common/step/configuration/step_check_tizen_version.h b/src/common/step/configuration/step_check_tizen_version.h index 82cdb90..efa5368 100644 --- a/src/common/step/configuration/step_check_tizen_version.h +++ b/src/common/step/configuration/step_check_tizen_version.h @@ -21,7 +21,7 @@ class StepCheckTizenVersion : public Step { Status undo() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(CheckTizenVersion) + STEP_NAME(CheckTizenVersion) }; } // namespace configuration diff --git a/src/common/step/configuration/step_configure.h b/src/common/step/configuration/step_configure.h index 902fc0d..2041344 100644 --- a/src/common/step/configuration/step_configure.h +++ b/src/common/step/configuration/step_configure.h @@ -64,7 +64,7 @@ class StepConfigure : public Step { PkgMgrPtr pkgmgr_; - SCOPE_LOG_TAG(Configure) + STEP_NAME(Configure) }; } // namespace configuration diff --git a/src/common/step/configuration/step_fail.h b/src/common/step/configuration/step_fail.h index d3a50c6..b51023e 100644 --- a/src/common/step/configuration/step_fail.h +++ b/src/common/step/configuration/step_fail.h @@ -32,7 +32,7 @@ class StepFail : public Step { Status undo() override { return Status::OK; } Status precheck() override { return Status::OK; } - SCOPE_LOG_TAG(Fail) + STEP_NAME(Fail) }; } // namespace configuration diff --git a/src/common/step/configuration/step_parse_manifest.h b/src/common/step/configuration/step_parse_manifest.h index be509a3..bd72285 100644 --- a/src/common/step/configuration/step_parse_manifest.h +++ b/src/common/step/configuration/step_parse_manifest.h @@ -98,7 +98,7 @@ class StepParseManifest : public common_installer::Step { ManifestLocation manifest_location_; StoreLocation store_location_; - SCOPE_LOG_TAG(ParseManifest) + STEP_NAME(ParseManifest) }; } // namespace configuration diff --git a/src/common/step/filesystem/step_acquire_external_storage.h b/src/common/step/filesystem/step_acquire_external_storage.h index e1e1789..5f583a5 100644 --- a/src/common/step/filesystem/step_acquire_external_storage.h +++ b/src/common/step/filesystem/step_acquire_external_storage.h @@ -26,7 +26,7 @@ class StepAcquireExternalStorage : public Step { Status undo() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(AcquireExternalStorage) + STEP_NAME(AcquireExternalStorage) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_clear_data.h b/src/common/step/filesystem/step_clear_data.h index 1696237..16cf013 100644 --- a/src/common/step/filesystem/step_clear_data.h +++ b/src/common/step/filesystem/step_clear_data.h @@ -28,7 +28,7 @@ class StepClearData : public Step { Status clean() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(ClearData) + STEP_NAME(ClearData) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_copy.h b/src/common/step/filesystem/step_copy.h index 598b5c9..d4887d2 100644 --- a/src/common/step/filesystem/step_copy.h +++ b/src/common/step/filesystem/step_copy.h @@ -47,7 +47,7 @@ class StepCopy : public Step { */ Status precheck() override; - SCOPE_LOG_TAG(Copy) + STEP_NAME(Copy) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_copy_storage_directories.h b/src/common/step/filesystem/step_copy_storage_directories.h index d7ebc0a..dafd04b 100644 --- a/src/common/step/filesystem/step_copy_storage_directories.h +++ b/src/common/step/filesystem/step_copy_storage_directories.h @@ -51,7 +51,7 @@ class StepCopyStorageDirectories : public common_installer::Step { const char *key, bool merge_dirs = false); bool CacheDir(); boost::filesystem::path backup_path_; - SCOPE_LOG_TAG(CopyStorageDirectories) + STEP_NAME(CopyStorageDirectories) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_copy_tep.h b/src/common/step/filesystem/step_copy_tep.h index 33c70a9..8c65ca7 100644 --- a/src/common/step/filesystem/step_copy_tep.h +++ b/src/common/step/filesystem/step_copy_tep.h @@ -46,7 +46,7 @@ class StepCopyTep : public Step { */ Status precheck() override; - SCOPE_LOG_TAG(CopyTEP) + STEP_NAME(CopyTEP) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_create_icons.h b/src/common/step/filesystem/step_create_icons.h index 00aa6fa..1e9d0d5 100644 --- a/src/common/step/filesystem/step_create_icons.h +++ b/src/common/step/filesystem/step_create_icons.h @@ -45,7 +45,7 @@ class StepCreateIcons : public Step { private: std::vector icons_; - SCOPE_LOG_TAG(CreateIcons) + STEP_NAME(CreateIcons) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_create_per_user_storage_directories.h b/src/common/step/filesystem/step_create_per_user_storage_directories.h index 30364ee..4d2a9fc 100644 --- a/src/common/step/filesystem/step_create_per_user_storage_directories.h +++ b/src/common/step/filesystem/step_create_per_user_storage_directories.h @@ -31,7 +31,7 @@ class StepCreatePerUserStorageDirectories : public common_installer::Step { Status undo() override { return Status::OK; } Status precheck() override { return Status::OK; } - SCOPE_LOG_TAG(CreatePerUserStorageDirectories) + STEP_NAME(CreatePerUserStorageDirectories) private: bool CreateExternalStorageDir(); diff --git a/src/common/step/filesystem/step_create_storage_directories.h b/src/common/step/filesystem/step_create_storage_directories.h index cecd0c6..0a523eb 100644 --- a/src/common/step/filesystem/step_create_storage_directories.h +++ b/src/common/step/filesystem/step_create_storage_directories.h @@ -40,7 +40,7 @@ class StepCreateStorageDirectories : public common_installer::Step { bool PrivateDir(); bool CacheDir(); - SCOPE_LOG_TAG(CreateStorageDirectories) + STEP_NAME(CreateStorageDirectories) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_delta_patch.h b/src/common/step/filesystem/step_delta_patch.h index 0f216b3..3bb3688 100644 --- a/src/common/step/filesystem/step_delta_patch.h +++ b/src/common/step/filesystem/step_delta_patch.h @@ -48,7 +48,7 @@ class StepDeltaPatch : public Step { boost::filesystem::path patch_dir_; std::string delta_root_; - SCOPE_LOG_TAG(DeltaPatch) + STEP_NAME(DeltaPatch) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_recover_external_storage.h b/src/common/step/filesystem/step_recover_external_storage.h index bc65cec..68bac1b 100644 --- a/src/common/step/filesystem/step_recover_external_storage.h +++ b/src/common/step/filesystem/step_recover_external_storage.h @@ -22,7 +22,7 @@ class StepRecoverExternalStorage : public StepAcquireExternalStorage { Status process() override; - SCOPE_LOG_TAG(RecoverExternalStorage) + STEP_NAME(RecoverExternalStorage) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_recover_files.h b/src/common/step/filesystem/step_recover_files.h index 90de483..9fc5b96 100644 --- a/src/common/step/filesystem/step_recover_files.h +++ b/src/common/step/filesystem/step_recover_files.h @@ -31,7 +31,7 @@ class StepRecoverFiles : public recovery::StepRecovery { private: bool SetPackagePath(); - SCOPE_LOG_TAG(RecoverBackup) + STEP_NAME(RecoverBackup) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_recover_icons.h b/src/common/step/filesystem/step_recover_icons.h index 5575307..4e3692e 100644 --- a/src/common/step/filesystem/step_recover_icons.h +++ b/src/common/step/filesystem/step_recover_icons.h @@ -40,7 +40,7 @@ class StepRecoverIcons : public recovery::StepRecovery { std::set> icons_; - SCOPE_LOG_TAG(RecoverIcons) + STEP_NAME(RecoverIcons) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_recover_manifest.h b/src/common/step/filesystem/step_recover_manifest.h index 3e9f400..d53eda4 100644 --- a/src/common/step/filesystem/step_recover_manifest.h +++ b/src/common/step/filesystem/step_recover_manifest.h @@ -31,7 +31,7 @@ class StepRecoverManifest : public recovery::StepRecovery { private: bool SetXmlPaths(); - SCOPE_LOG_TAG(RecoverManifest) + STEP_NAME(RecoverManifest) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_recover_storage_directories.h b/src/common/step/filesystem/step_recover_storage_directories.h index 3fbd696..bc5db7a 100644 --- a/src/common/step/filesystem/step_recover_storage_directories.h +++ b/src/common/step/filesystem/step_recover_storage_directories.h @@ -37,7 +37,7 @@ class StepRecoverStorageDirectories : public recovery::StepRecovery { const boost::filesystem::path& in_dst, const char *key); - SCOPE_LOG_TAG(RecoverStorageDirectories) + STEP_NAME(RecoverStorageDirectories) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_remove_files.h b/src/common/step/filesystem/step_remove_files.h index 51dda19..44ed784 100644 --- a/src/common/step/filesystem/step_remove_files.h +++ b/src/common/step/filesystem/step_remove_files.h @@ -23,7 +23,7 @@ class StepRemoveFiles : public Step { Status undo() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(Remove) + STEP_NAME(Remove) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_remove_icons.h b/src/common/step/filesystem/step_remove_icons.h index 57b92a2..60eb11b 100644 --- a/src/common/step/filesystem/step_remove_icons.h +++ b/src/common/step/filesystem/step_remove_icons.h @@ -27,7 +27,7 @@ class StepRemoveIcons : public Step { Status undo() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(RemoveIcons) + STEP_NAME(RemoveIcons) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_remove_per_user_storage_directories.h b/src/common/step/filesystem/step_remove_per_user_storage_directories.h index d0a9674..5dcae94 100644 --- a/src/common/step/filesystem/step_remove_per_user_storage_directories.h +++ b/src/common/step/filesystem/step_remove_per_user_storage_directories.h @@ -33,7 +33,7 @@ class StepRemovePerUserStorageDirectories : public common_installer::Step { Status undo() override { return Status::OK; } Status precheck() override { return Status::OK; } - SCOPE_LOG_TAG(RemovePerUserStorageDirectories) + STEP_NAME(RemovePerUserStorageDirectories) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_remove_temporary_directory.h b/src/common/step/filesystem/step_remove_temporary_directory.h index 5e1c804..809bd18 100644 --- a/src/common/step/filesystem/step_remove_temporary_directory.h +++ b/src/common/step/filesystem/step_remove_temporary_directory.h @@ -33,7 +33,7 @@ class StepRemoveTemporaryDirectory : public recovery::StepRecovery { */ void RemoveFiles(); - SCOPE_LOG_TAG(RemoveTemporaryDirectory) + STEP_NAME(RemoveTemporaryDirectory) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_remove_zip_image.h b/src/common/step/filesystem/step_remove_zip_image.h index 91b008e..4775015 100644 --- a/src/common/step/filesystem/step_remove_zip_image.h +++ b/src/common/step/filesystem/step_remove_zip_image.h @@ -29,7 +29,7 @@ class StepRemoveZipImage : public Step { Status undo() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(RemoveZipImage) + STEP_NAME(RemoveZipImage) }; } // namespace filesystem diff --git a/src/common/step/filesystem/step_unzip.h b/src/common/step/filesystem/step_unzip.h index aede813..7d9651e 100644 --- a/src/common/step/filesystem/step_unzip.h +++ b/src/common/step/filesystem/step_unzip.h @@ -38,7 +38,7 @@ class StepUnzip : public Step { Status undo() override; Status precheck() override; - SCOPE_LOG_TAG(Unzip) + STEP_NAME(Unzip) }; } // namespace filesystem diff --git a/src/common/step/mount/step_mount_install.h b/src/common/step/mount/step_mount_install.h index 5d37dcc..095e27c 100644 --- a/src/common/step/mount/step_mount_install.h +++ b/src/common/step/mount/step_mount_install.h @@ -35,7 +35,7 @@ class StepMountInstall : public Step { Status undo() override; Status precheck() override; - SCOPE_LOG_TAG(MountInstall) + STEP_NAME(MountInstall) }; } // namespace mount diff --git a/src/common/step/mount/step_mount_unpacked.h b/src/common/step/mount/step_mount_unpacked.h index d914275..f123ae2 100644 --- a/src/common/step/mount/step_mount_unpacked.h +++ b/src/common/step/mount/step_mount_unpacked.h @@ -32,7 +32,7 @@ class StepMountUnpacked : public Step { Status undo() override; Status precheck() override; - SCOPE_LOG_TAG(MountUnpacked) + STEP_NAME(MountUnpacked) }; } // namespace mount diff --git a/src/common/step/mount/step_mount_update.h b/src/common/step/mount/step_mount_update.h index b374a15..cd02e4d 100644 --- a/src/common/step/mount/step_mount_update.h +++ b/src/common/step/mount/step_mount_update.h @@ -35,7 +35,7 @@ class StepMountUpdate : public Step { Status undo() override; Status precheck() override; - SCOPE_LOG_TAG(MountUpdate) + STEP_NAME(MountUpdate) }; } // namespace mount diff --git a/src/common/step/pkgmgr/step_check_removable.h b/src/common/step/pkgmgr/step_check_removable.h index 18c7fb9..59b190f 100644 --- a/src/common/step/pkgmgr/step_check_removable.h +++ b/src/common/step/pkgmgr/step_check_removable.h @@ -19,7 +19,7 @@ class StepCheckRemovable : public Step { Status clean() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(CheckRemovable) + STEP_NAME(CheckRemovable) }; } // namespace pkgmgr diff --git a/src/common/step/pkgmgr/step_kill_apps.h b/src/common/step/pkgmgr/step_kill_apps.h index d1e9d17..b84f969 100644 --- a/src/common/step/pkgmgr/step_kill_apps.h +++ b/src/common/step/pkgmgr/step_kill_apps.h @@ -38,7 +38,7 @@ class StepKillApps : public Step { */ Status precheck() override; - SCOPE_LOG_TAG(KillApps) + STEP_NAME(KillApps) }; } // namespace pkgmgr diff --git a/src/common/step/pkgmgr/step_recover_application.h b/src/common/step/pkgmgr/step_recover_application.h index 84e7146..56624a8 100644 --- a/src/common/step/pkgmgr/step_recover_application.h +++ b/src/common/step/pkgmgr/step_recover_application.h @@ -28,7 +28,7 @@ class StepRecoverApplication : public recovery::StepRecovery { private: bool SetXmlPaths(); - SCOPE_LOG_TAG(RecoverApplication) + STEP_NAME(RecoverApplication) }; } // namespace pkgmgr diff --git a/src/common/step/pkgmgr/step_register_app.h b/src/common/step/pkgmgr/step_register_app.h index 8387211..965a410 100644 --- a/src/common/step/pkgmgr/step_register_app.h +++ b/src/common/step/pkgmgr/step_register_app.h @@ -20,7 +20,7 @@ class StepRegisterApplication : public Step { Status undo() override; Status precheck() override; - SCOPE_LOG_TAG(RegisterApp) + STEP_NAME(RegisterApp) }; } // namespace pkgmgr diff --git a/src/common/step/pkgmgr/step_remove_manifest.h b/src/common/step/pkgmgr/step_remove_manifest.h index 8688cfc..6f19533 100644 --- a/src/common/step/pkgmgr/step_remove_manifest.h +++ b/src/common/step/pkgmgr/step_remove_manifest.h @@ -31,7 +31,7 @@ class StepRemoveManifest : public Step { Status undo() override { return Status::OK; } Status precheck() override { return Status::OK; } - SCOPE_LOG_TAG(RemoveManifest) + STEP_NAME(RemoveManifest) }; } // namespace pkgmgr diff --git a/src/common/step/pkgmgr/step_run_parser_plugins.h b/src/common/step/pkgmgr/step_run_parser_plugins.h index a547c6d..4b9c41a 100644 --- a/src/common/step/pkgmgr/step_run_parser_plugins.h +++ b/src/common/step/pkgmgr/step_run_parser_plugins.h @@ -35,7 +35,7 @@ class StepRunParserPlugin : public Step { Plugin::ActionType action_type_; - SCOPE_LOG_TAG(RunParserPlugin) + STEP_NAME(RunParserPlugin) }; } // namespace pkgmgr diff --git a/src/common/step/pkgmgr/step_unregister_app.h b/src/common/step/pkgmgr/step_unregister_app.h index 9eeed6c..91ce0f6 100644 --- a/src/common/step/pkgmgr/step_unregister_app.h +++ b/src/common/step/pkgmgr/step_unregister_app.h @@ -25,7 +25,7 @@ class StepUnregisterApplication : public Step { private: bool BackupCertInfo(); - SCOPE_LOG_TAG(Unregister) + STEP_NAME(Unregister) }; } // namespace pkgmgr diff --git a/src/common/step/pkgmgr/step_update_app.h b/src/common/step/pkgmgr/step_update_app.h index 788b2d7..c9008d3 100644 --- a/src/common/step/pkgmgr/step_update_app.h +++ b/src/common/step/pkgmgr/step_update_app.h @@ -22,7 +22,7 @@ class StepUpdateApplication : public Step { Status undo() override; Status precheck() override; - SCOPE_LOG_TAG(UpdateApplication) + STEP_NAME(UpdateApplication) }; } // namespace pkgmgr diff --git a/src/common/step/pkgmgr/step_update_tep.h b/src/common/step/pkgmgr/step_update_tep.h index c00f715..7d19a74 100644 --- a/src/common/step/pkgmgr/step_update_tep.h +++ b/src/common/step/pkgmgr/step_update_tep.h @@ -25,7 +25,7 @@ class StepUpdateTep : public Step { Status undo() override; Status precheck() override { return Status::OK; } - SCOPE_LOG_TAG(UpdateTep) + STEP_NAME(UpdateTep) }; } // namespace pkgmgr diff --git a/src/common/step/rds/step_rds_parse.h b/src/common/step/rds/step_rds_parse.h index 8bbdf49..d676dcc 100644 --- a/src/common/step/rds/step_rds_parse.h +++ b/src/common/step/rds/step_rds_parse.h @@ -47,6 +47,8 @@ class StepRDSParse : public Step { private: boost::filesystem::path rds_file_path_; + + STEP_NAME(RDSParse) }; } // namespace rds diff --git a/src/common/step/recovery/step_open_recovery_file.h b/src/common/step/recovery/step_open_recovery_file.h index dda174d..8c80c12 100644 --- a/src/common/step/recovery/step_open_recovery_file.h +++ b/src/common/step/recovery/step_open_recovery_file.h @@ -23,7 +23,7 @@ class StepOpenRecoveryFile : public Step { Status undo() override; Status precheck() override { return Status::OK; } - SCOPE_LOG_TAG(OpenRecoveryFile) + STEP_NAME(OpenRecoveryFile) }; } // namespace recovery diff --git a/src/common/step/security/step_check_background_category.h b/src/common/step/security/step_check_background_category.h index 46e275b..6eb0da4 100644 --- a/src/common/step/security/step_check_background_category.h +++ b/src/common/step/security/step_check_background_category.h @@ -92,7 +92,7 @@ class StepCheckBackgroundCategory : public common_installer::Step { const BackgroundCatSet known_background_categories_; const BackgroundCatSet not_unknown_background_categories_; - SCOPE_LOG_TAG(CheckBackgroundCategory) + STEP_NAME(CheckBackgroundCategory) }; } // namespace security diff --git a/src/common/step/security/step_check_old_certificate.h b/src/common/step/security/step_check_old_certificate.h index f3c8e12..1cbb72a 100644 --- a/src/common/step/security/step_check_old_certificate.h +++ b/src/common/step/security/step_check_old_certificate.h @@ -31,7 +31,7 @@ class StepCheckOldCertificate : public Step { Status clean() override { return Status::OK; } Status precheck() override { return Status::OK; } - SCOPE_LOG_TAG(CheckOldCertificate) + STEP_NAME(CheckOldCertificate) }; } // namespace security diff --git a/src/common/step/security/step_check_signature.h b/src/common/step/security/step_check_signature.h index e71671b..ab63df5 100644 --- a/src/common/step/security/step_check_signature.h +++ b/src/common/step/security/step_check_signature.h @@ -52,7 +52,7 @@ class StepCheckSignature : public Step { Status CheckSignatureMismatch(); Status CheckPrivilegeLevel(PrivilegeLevel level); - SCOPE_LOG_TAG(Signature) + STEP_NAME(Signature) }; } // namespace security diff --git a/src/common/step/security/step_privilege_compatibility.h b/src/common/step/security/step_privilege_compatibility.h index 30a0015..83da70e 100644 --- a/src/common/step/security/step_privilege_compatibility.h +++ b/src/common/step/security/step_privilege_compatibility.h @@ -27,7 +27,7 @@ class StepPrivilegeCompatibility : public Step { Status undo() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(PrivilegeCompatibility) + STEP_NAME(PrivilegeCompatibility) }; } // namespace security diff --git a/src/common/step/security/step_recover_security.h b/src/common/step/security/step_recover_security.h index 429df46..837ea89 100644 --- a/src/common/step/security/step_recover_security.h +++ b/src/common/step/security/step_recover_security.h @@ -32,7 +32,7 @@ class StepRecoverSecurity : public recovery::StepRecovery { private: bool Check(); - SCOPE_LOG_TAG(RecoverSecurity) + STEP_NAME(RecoverSecurity) }; } // namespace security diff --git a/src/common/step/security/step_register_security.h b/src/common/step/security/step_register_security.h index b4bfb06..d107ef1 100644 --- a/src/common/step/security/step_register_security.h +++ b/src/common/step/security/step_register_security.h @@ -21,7 +21,7 @@ class StepRegisterSecurity : public Step { Status clean() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(Security) + STEP_NAME(Security) }; } // namespace security diff --git a/src/common/step/security/step_revoke_security.h b/src/common/step/security/step_revoke_security.h index 14645fd..2c27589 100644 --- a/src/common/step/security/step_revoke_security.h +++ b/src/common/step/security/step_revoke_security.h @@ -24,7 +24,7 @@ class StepRevokeSecurity : public Step { Status clean() override; Status precheck() override; - SCOPE_LOG_TAG(RevokeSecurity) + STEP_NAME(RevokeSecurity) }; } // namespace security diff --git a/src/common/step/security/step_rollback_deinstallation_security.h b/src/common/step/security/step_rollback_deinstallation_security.h index 3ad3f27..cbca2f0 100644 --- a/src/common/step/security/step_rollback_deinstallation_security.h +++ b/src/common/step/security/step_rollback_deinstallation_security.h @@ -23,7 +23,7 @@ class StepRollbackDeinstallationSecurity : public Step { Status clean() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(RollbackDeinstallationSecurity) + STEP_NAME(RollbackDeinstallationSecurity) }; } // namespace security diff --git a/src/common/step/security/step_rollback_installation_security.h b/src/common/step/security/step_rollback_installation_security.h index 58bd0e1..65408fe 100644 --- a/src/common/step/security/step_rollback_installation_security.h +++ b/src/common/step/security/step_rollback_installation_security.h @@ -24,7 +24,7 @@ class StepRollbackInstallationSecurity : public Step { Status clean() override { return Status::OK; } Status precheck() override; - SCOPE_LOG_TAG(RollbackInstallationSecurity) + STEP_NAME(RollbackInstallationSecurity) }; } // namespace security diff --git a/src/common/step/security/step_update_security.h b/src/common/step/security/step_update_security.h index 0578269..6c78e41 100644 --- a/src/common/step/security/step_update_security.h +++ b/src/common/step/security/step_update_security.h @@ -21,7 +21,7 @@ class StepUpdateSecurity : public Step { Status clean() override { return Status::OK; } Status precheck() override { return Status::OK; } - SCOPE_LOG_TAG(UpdateSecurity) + STEP_NAME(UpdateSecurity) }; } // namespace security diff --git a/src/common/step/step.h b/src/common/step/step.h index b072c36..304566b 100644 --- a/src/common/step/step.h +++ b/src/common/step/step.h @@ -33,6 +33,11 @@ #include "common/installer_context.h" +// This macro should be defined at the end of class definition +#define STEP_NAME(NAME) \ + SCOPE_LOG_TAG(NAME) \ + const char* name() const override { return #NAME; } \ + namespace common_installer { /** @@ -93,6 +98,9 @@ class Step { /** Checks the input data used during process method */ virtual Status precheck() = 0; + /** Returns step name */ + virtual const char* name() const = 0; + StepErrorSignal on_error; protected: -- 2.7.4