You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A unified Logger and ProgressBar util with zero dependencies.
Features
Once logging: log.info.once("this log msg will be only logged once")
Progress Bar: progress_bar = log.pb(100)
Sticky Bottom Progress Bar: Default behavior!
Logging and Porgress Bar work hand-in-hand with no conflict: logs are printed before the progress bar
Usage:
# logslog=LogBar.shared() # <-- single global log (optional), shared everywherelog.info("super log!")
log.info.once("Show only once")
log.info.once("Show only once") # <-- not logged# progress barpb=log.pb(100) # <-- pass in any iterable or intfor_inpb:
time.sleep(0.1)
# advanced progress bar usage# progress bar with fixed titlepb=log.pb(100).title("Super Bar:") # <-- set fixed titlefor_inpb:
time.sleep(0.1)
# advanced progress bar usage# progress bar with fixed title and dynamic sub_title# dynamic title/sub_title requires manual calls to `draw()` show progress correctly in correct orderpb=log.pb(names_list).title("Processing Model").manual() # <-- switch to manual render mode: call `draw()` manuallyfornameinpb:
start=time.time()
log.info(f"{name} is about to be worked on...") # <-- logs and progress bar do not conflictpb.subtitle(f"Processing Module: {name}").draw()
log.info(f"{name} completed: took {time.time()-start} secs")
time.sleep(0.1)
tqdm replacement
Replacing tqdm with logbar is effortless and most time most pythonic and easier to use while being more powerful in the construction