Update private_logger.py (#1025)
Minor optimization of logs. Added lazy loading of images.
This commit is contained in:
parent
3bc9ac88fd
commit
ec57c1fde0
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue