1414from edkrepo .commands .edkrepo_command import EdkrepoCommand , OverrideArgument , SourceManifestRepoArgument
1515import edkrepo .commands .arguments .checkout_pin_args as arguments
1616import edkrepo .commands .humble .checkout_pin_humble as humble
17+ from edkrepo .common .logger import get_logger
1718from edkrepo .common .common_cache_functions import get_repo_cache_obj
1819from edkrepo .common .common_repo_functions import sparse_checkout_enabled , reset_sparse_checkout , sparse_checkout
1920from edkrepo .common .common_repo_functions import check_dirty_repos , checkout_repos , combinations_in_manifest
@@ -50,6 +51,7 @@ def get_metadata(self):
5051 return metadata
5152
5253 def run_command (self , args , config ):
54+ logger = get_logger ()
5355 workspace_path = get_workspace_path ()
5456 manifest = get_workspace_manifest ()
5557
@@ -74,15 +76,14 @@ def run_command(self, args, config):
7476 self .__pin_matches_project (pin , manifest , workspace_path )
7577 sparse_enabled = sparse_checkout_enabled (workspace_path , manifest_sources )
7678 if sparse_enabled :
77- ui_functions . print_info_msg (SPARSE_RESET , header = False )
79+ logger . info (SPARSE_RESET )
7880 reset_sparse_checkout (workspace_path , manifest_sources )
7981 submodule_combo = pin .general_config .current_combo
8082 try :
8183 deinit_full (workspace_path , manifest , args .verbose )
8284 except Exception as e :
83- ui_functions .print_error_msg (SUBMODULE_DEINIT_FAILED , header = False )
84- if args .verbose :
85- ui_functions .print_error_msg (e , header = False )
85+ logger .error (SUBMODULE_DEINIT_FAILED )
86+ logger .error (e , extra = {'verbose' :args .verbose })
8687 pin_repo_sources = pin .get_repo_sources (pin .general_config .current_combo )
8788 try :
8889 checkout_repos (args .verbose , args .override , pin_repo_sources , workspace_path , manifest )
@@ -94,7 +95,7 @@ def run_command(self, args, config):
9495 cache_path = cache_obj .get_cache_path (SUBMODULE_CACHE_REPO_NAME )
9596 maintain_submodules (workspace_path , pin , submodule_combo , args .verbose , cache_path )
9697 if sparse_enabled :
97- ui_functions . print_info_msg (SPARSE_CHECKOUT , header = False )
98+ logger . info (SPARSE_CHECKOUT , header = False )
9899 sparse_checkout (workspace_path , pin_repo_sources , manifest )
99100
100101 def __get_pin_path (self , args , workspace_path , manifest_repo_path , manifest ):
@@ -115,13 +116,13 @@ def __get_pin_path(self, args, workspace_path, manifest_repo_path, manifest):
115116 else :
116117 raise EdkrepoInvalidParametersException (humble .NOT_FOUND )
117118
118- def __pin_matches_project (self , pin , manifest , workspace_path ):
119+ def __pin_matches_project (self , logger , pin , manifest , workspace_path ):
119120 if pin .project_info .codename != manifest .project_info .codename :
120121 raise EdkrepoProjectMismatchException (humble .MANIFEST_MISMATCH )
121122 elif not set (pin .remotes ).issubset (set (manifest .remotes )):
122123 raise EdkrepoProjectMismatchException (humble .MANIFEST_MISMATCH )
123124 elif pin .general_config .current_combo not in combinations_in_manifest (manifest ):
124- ui_functions . print_warning_msg (humble .COMBO_NOT_FOUND .format (pin .general_config .current_combo ), header = False )
125+ logger . warning (humble .COMBO_NOT_FOUND .format (pin .general_config .current_combo ))
125126 combo_name = pin .general_config .current_combo
126127 pin_sources = pin .get_repo_sources (combo_name )
127128 pin_root_remote = {source .root :source .remote_name for source in pin_sources }
0 commit comments