aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-10-01 07:51:23 +0530
committersinanmohd <sinan@sinanmohd.com>2023-10-01 08:42:13 +0530
commit65390e78d5d01d66feebfb9a38f21464e09c80ac (patch)
tree24417e1588ad76fc496353a11ffdb0f1f5db022e /lib
parentdbc20e0a10883b8cb44343432d4539009a45611b (diff)
util: init error logging
Diffstat (limited to 'lib')
-rw-r--r--lib/util.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/util.lua b/lib/util.lua
index 15221dd..a1de817 100644
--- a/lib/util.lua
+++ b/lib/util.lua
@@ -63,10 +63,20 @@ local string_rm_vid_ext = function (str)
return str
end
+local error = function (str)
+ str = 'error: ' .. str
+ if mp then
+ mp.msg.warn(str)
+ else
+ print(str)
+ end
+end
+
return {
table_merge = table_merge,
table_print = table_print,
table_match_or_any = table_match_or_any,
zip_ext_first = zip_ext_first,
string_rm_vid_ext = string_rm_vid_ext,
+ error = error,
}