Update private_logger.py (#1025)

Minor optimization of logs. Added lazy loading of images.
This commit is contained in:
oivasenk 2023-11-24 11:31:20 +02:00 committed by GitHub
parent 3bc9ac88fd
commit ec57c1fde0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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: