Skip to content

Commit

Permalink
redirect to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
siyuan0322 committed Oct 18, 2021
1 parent 5fc9d24 commit 667ab36
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions coordinator/gscoordinator/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# limitations under the License.
#

import sys
import threading
from queue import Queue

Expand Down Expand Up @@ -79,19 +80,20 @@ def _show_progress(self):
total = len(LoadingProgressTracker.stubs)
if LoadingProgressTracker.progbar is None:
LoadingProgressTracker.progbar = tqdm(
desc="Loading", total=total, file=self._stream_backup
desc="Loading Graph", total=total, file=sys.stderr
)
LoadingProgressTracker.progbar.update(1)
LoadingProgressTracker.cur_stub += 1
if LoadingProgressTracker.cur_stub == total:
LoadingProgressTracker.cur_stub = 0
LoadingProgressTracker.progbar.close()
LoadingProgressTracker.progbar = None
self._stream_backup.write("\n")
sys.stderr.write("\n")
sys.stderr.flush()

def _filter_progress(self, line):
# print('show_progress: ', len(line), ", ", line)
if "PROGRESS--" not in line:
if "PROGRESS--GRAPH" not in line:
return line
self._show_progress(line)
return None
Expand Down

0 comments on commit 667ab36

Please sign in to comment.