Update __init__.py

Auto convert log messages to strings on the way in
This commit is contained in:
Nathan Petrangelo 2023-06-05 17:31:52 -04:00 committed by GitHub
parent 97f97eb063
commit 6ce979a7de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ def timestamp_str(time_s):
def log(msg, level=3, _override_destination = False):
global _always_override_destination, compact_log_fmt
msg = str(msg)
if loglevel >= level:
if not compact_log_fmt:
logstring = "["+timestamp_str(time.time())+"] ["+loglevelname(level)+"] "+msg
@ -238,4 +238,4 @@ def panic():
def exit():
print("")
sys.exit(0)
sys.exit(0)