diff options
author | sinanmohd <sinan@sinanmohd.com> | 2023-10-01 07:51:23 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2023-10-01 08:42:13 +0530 |
commit | 65390e78d5d01d66feebfb9a38f21464e09c80ac (patch) | |
tree | 24417e1588ad76fc496353a11ffdb0f1f5db022e /lib | |
parent | dbc20e0a10883b8cb44343432d4539009a45611b (diff) |
util: init error logging
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.lua | 10 |
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, } |