Update private_logger.py (#1025)

Minor optimization of logs. Added lazy loading of images.
This commit is contained in:
oivasenk
2023-11-24 01:31:20 -08:00
committed by GitHub
parent 3bc9ac88fd
commit ec57c1fde0
+1 -1
View File
@@ -44,7 +44,7 @@ def log(img, dic, single_line_number=3):
item += f"<p>{k}: <b>{v}</b>, "
else:
item += f"{k}: <b>{v}</b></p>\n"
item += f"<p><img src=\"{only_name}\" width=512 onerror=\"document.getElementById('{div_name}').style.display = 'none';\"></img></p><hr></div>\n"
item += f"<p><img src=\"{only_name}\" width=auto height=100% loading=lazy style=\"height:auto;max-width:512px\" onerror=\"document.getElementById('{div_name}').style.display = 'none';\"></img></p><hr></div>\n"
existing_log = item + existing_log
with open(html_name, 'w', encoding='utf-8') as f: