diff options
author | Aravind Vasudevan <aravindvasudev@google.com> | 2023-09-06 18:01:20 +0000 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-09-11 21:38:55 +0000 |
commit | 57718974599a266e99174cf3892ed4a06a87dcbe (patch) | |
tree | e9052a14f1da122b9018904b6378f039f9cdeffd /subcmds/start.py | |
parent | 56a5a01c659ab005d9a0820f16e927e6253ab80c (diff) | |
download | git-repo-57718974599a266e99174cf3892ed4a06a87dcbe.tar.gz |
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 <aravindvasudev@google.com>
Reviewed-by: Jason Chang <jasonnc@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Diffstat (limited to 'subcmds/start.py')
-rw-r--r-- | subcmds/start.py | 18 |
1 files 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 @@ | |||
13 | # limitations under the License. | 13 | # limitations under the License. |
14 | 14 | ||
15 | import functools | 15 | import functools |
16 | import sys | ||
17 | from typing import NamedTuple | 16 | from typing import NamedTuple |
18 | 17 | ||
19 | from command import Command | 18 | from command import Command |
@@ -23,6 +22,10 @@ from git_command import git | |||
23 | from git_config import IsImmutable | 22 | from git_config import IsImmutable |
24 | from progress import Progress | 23 | from progress import Progress |
25 | from project import Project | 24 | from project import Project |
25 | from repo_logging import RepoLogger | ||
26 | |||
27 | |||
28 | logger = RepoLogger(__file__) | ||
26 | 29 | ||
27 | 30 | ||
28 | class ExecuteOneResult(NamedTuple): | 31 | class ExecuteOneResult(NamedTuple): |
@@ -95,10 +98,7 @@ revision specified in the manifest. | |||
95 | nb, branch_merge=branch_merge, revision=revision | 98 | nb, branch_merge=branch_merge, revision=revision |
96 | ) | 99 | ) |
97 | except Exception as e: | 100 | except Exception as e: |
98 | print( | 101 | logger.error("error: unable to checkout %s: %s", project.name, e) |
99 | "error: unable to checkout %s: %s" % (project.name, e), | ||
100 | file=sys.stderr, | ||
101 | ) | ||
102 | error = e | 102 | error = e |
103 | return ExecuteOneResult(project, error) | 103 | return ExecuteOneResult(project, error) |
104 | 104 | ||
@@ -136,10 +136,10 @@ revision specified in the manifest. | |||
136 | 136 | ||
137 | if err_projects: | 137 | if err_projects: |
138 | for p in err_projects: | 138 | for p in err_projects: |
139 | print( | 139 | logger.error( |
140 | "error: %s/: cannot start %s" | 140 | "error: %s/: cannot start %s", |
141 | % (p.RelPath(local=opt.this_manifest_only), nb), | 141 | p.RelPath(local=opt.this_manifest_only), |
142 | file=sys.stderr, | 142 | nb, |
143 | ) | 143 | ) |
144 | msg_fmt = "cannot start %d project(s)" | 144 | msg_fmt = "cannot start %d project(s)" |
145 | self.git_event_log.ErrorEvent( | 145 | self.git_event_log.ErrorEvent( |