diff --git a/dlio_benchmark/utils/utility.py b/dlio_benchmark/utils/utility.py index 0442a0d8..61bcbd75 100644 --- a/dlio_benchmark/utils/utility.py +++ b/dlio_benchmark/utils/utility.py @@ -184,13 +184,13 @@ def initialize_log(logdir, data_dir): os.remove(instance.log_file) spec = importlib.util.find_spec('dlio_profiler_py') if spec: + logging.info(f"{utcnow()} Using DLIO Profiler") instance.logger_type = LoggerType.DLIO_PROFILER import dlio_profiler_py as dlio_logger instance.logger = dlio_logger instance.logger.initialize(instance.log_file, f"{data_dir}", process_id=get_rank()) - with open(instance.log_file, 'w') as f: - f.write("[") else: + logging.info(f"{utcnow()} Using Internal Profiler.") instance.logger = logging.getLogger("perftrace") instance.logger.setLevel(logging.DEBUG) instance.logger.propagate = False @@ -219,8 +219,6 @@ def log_event(self, name, cat, start_time, duration, int_args=None): def finalize(self): if self.logger_type == LoggerType.DLIO_PROFILER: self.logger.finalize() - with open(self.log_file, 'a') as f: - f.write("]") else: self.logger.debug("]")