trace: restore Progress indicator.
If we are not tracing to stderr, then we should still have progress
indication.
Change-Id: Ifc9678e1fccbd92251e972fcf25aad6369d60e15
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/351195
Reviewed-by: Sam Saccone <samccone@google.com>
Tested-by: LaMont Jones <lamontjones@google.com>
Reviewed-by: Xin Li <delphij@google.com>
diff --git a/repo_trace.py b/repo_trace.py
index 86cbfc6..9016cb0 100644
--- a/repo_trace.py
+++ b/repo_trace.py
@@ -32,19 +32,14 @@
# Temporarily set tracing to always on unless user expicitly sets to 0.
_TRACE = os.environ.get(REPO_TRACE) != '0'
-
_TRACE_TO_STDERR = False
-
_TRACE_FILE = None
-
_TRACE_FILE_NAME = 'TRACE_FILE'
-
_MAX_SIZE = 70 # in mb
-
_NEW_COMMAND_SEP = '+++++++++++++++NEW COMMAND+++++++++++++++++++'
-def IsStraceToStderr():
+def IsTraceToStderr():
return _TRACE_TO_STDERR
@@ -90,7 +85,7 @@
if not IsTrace():
return self
- print_msg = f"PID: {os.getpid()} START: {self._time()} :" + self._trace_msg + '\n'
+ print_msg = f'PID: {os.getpid()} START: {self._time()} :' + self._trace_msg + '\n'
with open(_TRACE_FILE, 'a') as f:
print(print_msg, file=f)
@@ -104,7 +99,7 @@
if not IsTrace():
return False
- print_msg = f"PID: {os.getpid()} END: {self._time()} :" + self._trace_msg + '\n'
+ print_msg = f'PID: {os.getpid()} END: {self._time()} :' + self._trace_msg + '\n'
with open(_TRACE_FILE, 'a') as f:
print(print_msg, file=f)