diff options
author | Joanna Wang <jojwang@google.com> | 2022-11-03 16:51:19 -0400 |
---|---|---|
committer | Joanna Wang <jojwang@google.com> | 2022-11-03 21:07:07 +0000 |
commit | a6c52f566acfbff5b0f37158c0d33adf05d250e5 (patch) | |
tree | d79d55b872c3be39c54dcb6ef41749c40d39ccf2 /git_config.py | |
parent | 0d130d2da0754c546f654ede99a79aac2b8e6c5f (diff) | |
download | git-repo-a6c52f566acfbff5b0f37158c0d33adf05d250e5.tar.gz |
Set tracing to always on and save to .repo/TRACE_FILE.
- add `--trace_to_stderr` option so stderr will include trace outputs and any other errors that get sent to stderr
- while TRACE_FILE will only include trace outputs
piggy-backing on: https://gerrit-review.googlesource.com/c/git-repo/+/349154
Change-Id: I3895a84de4b2784f17fac4325521cd5e72e645e2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/350114
Reviewed-by: LaMont Jones <lamontjones@google.com>
Tested-by: Joanna Wang <jojwang@google.com>
Diffstat (limited to 'git_config.py')
-rw-r--r-- | git_config.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/git_config.py b/git_config.py index 6f80ae08..98cade32 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -349,9 +349,9 @@ class GitConfig(object): | |||
349 | except OSError: | 349 | except OSError: |
350 | return None | 350 | return None |
351 | try: | 351 | try: |
352 | Trace(': parsing %s', self.file) | 352 | with Trace(': parsing %s', self.file): |
353 | with open(self._json) as fd: | 353 | with open(self._json) as fd: |
354 | return json.load(fd) | 354 | return json.load(fd) |
355 | except (IOError, ValueError): | 355 | except (IOError, ValueError): |
356 | platform_utils.remove(self._json, missing_ok=True) | 356 | platform_utils.remove(self._json, missing_ok=True) |
357 | return None | 357 | return None |