Is there a way to recover custom logs from submissions?
Below is a sample minimal code that times the processing of each test image and writes the result to the default logger (recovered with logger.getLogger()). The timings, however, do not appear in the execution logs recovered from the code execution status page. Is this on purpose, or should I use another Logger instance?
import pandas as pd
import os
import logging
import time
from random import randrange
if __name__=="__main__":
logger = logging.getLogger()
text_output = 'filename,0,1,2,3\n'
df = pd.read_csv(os.path.join("data", "test_metadata.csv"))
logger.info("Start of main loop")
t_start = time.time()
for filename in df.filename:
# Do something
prediction = randrange(4)
line_output = filename + ',' + ','.join([str(int(ii==prediction)) for ii in range(4)]) + '\n'
text_output += line_output
t_end = time.time()
logger.info(f"Processed {filename} in {t_end-t_start:.1f} seconds")
t_start = t_end
logger.info("Processing complete, printing on csv")
with open("submission.csv", "w") as fo:
fo.write(text_output)