Skip to content

Commit

Permalink
Fix stdout logging (#1073)
Browse files Browse the repository at this point in the history
When the log folder is not specified, the test runner currently fails saying that None can't be added to a string for obvious reasons.
  • Loading branch information
sfc-gh-azwiegincew authored Oct 4, 2023
1 parent e93d054 commit 1e1860d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/perf/long_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ def gather_cpu_memory():
)
args = parser.parse_args()
log_folder = args.log_folder
output_file_path = f"{log_folder if log_folder and log_folder[-1] == '/' else log_folder + '/'}long_running_{datetime.datetime.now().strftime('%Y%m%d-%H%M%S')}.log"
logger = logging.getLogger("long-running")
logger.setLevel(logging.INFO)
if log_folder:
logger.addHandler(logging.FileHandler(output_file_path))
log_file_path = f"{log_folder if log_folder[-1] == '/' else log_folder + '/'}long_running_{datetime.datetime.now().strftime('%Y%m%d-%H%M%S')}.log"
logger.addHandler(logging.FileHandler(log_file_path))
else:
logger.addHandler(logging.StreamHandler(sys.stdout))
log_header = {
Expand Down

0 comments on commit 1e1860d

Please sign in to comment.