From 57718974599a266e99174cf3892ed4a06a87dcbe Mon Sep 17 00:00:00 2001 From: Aravind Vasudevan Date: Wed, 6 Sep 2023 18:01:20 +0000 Subject: [PATCH] start: Use repo logger Bug: b/292704435 Change-Id: I7b8988207dfdcf0ffc283a48499611892ef5187d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385534 Tested-by: Aravind Vasudevan Reviewed-by: Jason Chang Commit-Queue: Aravind Vasudevan --- subcmds/start.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/subcmds/start.py b/subcmds/start.py index 7a42b26c..fd177f9e 100644 --- a/subcmds/start.py +++ b/subcmds/start.py @@ -13,7 +13,6 @@ # limitations under the License. import functools -import sys from typing import NamedTuple from command import Command @@ -23,6 +22,10 @@ from git_command import git from git_config import IsImmutable from progress import Progress from project import Project +from repo_logging import RepoLogger + + +logger = RepoLogger(__file__) class ExecuteOneResult(NamedTuple): @@ -95,10 +98,7 @@ revision specified in the manifest. nb, branch_merge=branch_merge, revision=revision ) except Exception as e: - print( - "error: unable to checkout %s: %s" % (project.name, e), - file=sys.stderr, - ) + logger.error("error: unable to checkout %s: %s", project.name, e) error = e return ExecuteOneResult(project, error) @@ -136,10 +136,10 @@ revision specified in the manifest. if err_projects: for p in err_projects: - print( - "error: %s/: cannot start %s" - % (p.RelPath(local=opt.this_manifest_only), nb), - file=sys.stderr, + logger.error( + "error: %s/: cannot start %s", + p.RelPath(local=opt.this_manifest_only), + nb, ) msg_fmt = "cannot start %d project(s)" self.git_event_log.ErrorEvent(