use iopath to handle append error
Summary:
@@ -100,7 +100,8 @@ def setup_logger(
# with the same file name can safely write to the same file.
@functools.lru_cache(maxsize=None)
def _cached_log_stream(filename):
- io = PathManager.open(filename, "a")
+ # use 1K buffer if writing to cloud storage
+ io = PathManager.open(filename, "a", buffering=1024 if "://" in filename else -1)
atexit.register(io.close)
return io
