summaryrefslogtreecommitdiff
path: root/python/log.py
diff options
context:
space:
mode:
authorJordan Wiens <jordan@psifertex.com>2022-02-10 09:18:06 -0500
committerJordan Wiens <jordan@psifertex.com>2022-02-10 09:18:06 -0500
commitda39c4b195cdd04290cfb285ac33b455f7bfc3cd (patch)
treee0b24a47324f86f83644fb95ea06c8659f3af0d4 /python/log.py
parenta5eb8bfdc1affa6d2330484800808c4d34f23103 (diff)
fixes #2959; some type checking on log APIs
Diffstat (limited to 'python/log.py')
-rw-r--r--python/log.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/log.py b/python/log.py
index 04d8693a..98aef1eb 100644
--- a/python/log.py
+++ b/python/log.py
@@ -53,6 +53,8 @@ def log(level, text):
:param str text: message to print
:rtype: None
"""
+ if not isinstance(text, str):
+ text = str(text)
core.BNLogString(level, text)
@@ -68,6 +70,8 @@ def log_debug(text):
>>> log_debug("Hotdogs!")
Hotdogs!
"""
+ if not isinstance(text, str):
+ text = str(text)
core.BNLogString(LogLevel.DebugLog, text)
@@ -83,6 +87,8 @@ def log_info(text):
Saucisson!
>>>
"""
+ if not isinstance(text, str):
+ text = str(text)
core.BNLogString(LogLevel.InfoLog, text)
@@ -99,6 +105,8 @@ def log_warn(text):
Chilidogs!
>>>
"""
+ if not isinstance(text, str):
+ text = str(text)
core.BNLogString(LogLevel.WarningLog, text)
@@ -115,6 +123,8 @@ def log_error(text):
Spanferkel!
>>>
"""
+ if not isinstance(text, str):
+ text = str(text)
core.BNLogString(LogLevel.ErrorLog, text)
@@ -131,6 +141,8 @@ def log_alert(text):
Kielbasa!
>>>
"""
+ if not isinstance(text, str):
+ text = str(text)
core.BNLogString(LogLevel.AlertLog, text)