diff options
Diffstat (limited to 'xmake/scripts/base/utils.lua')
| -rw-r--r-- | xmake/scripts/base/utils.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/xmake/scripts/base/utils.lua b/xmake/scripts/base/utils.lua index 738013a76..fd1f053d6 100644 --- a/xmake/scripts/base/utils.lua +++ b/xmake/scripts/base/utils.lua @@ -25,23 +25,44 @@ local utils = utils or {} -- the printf function function utils.printf(msg, ...) + + -- check + assert(msg) + + -- trace print(string.format(msg, ...)) end -- the verbose function function utils.verbose(msg, ...) + if xmake._OPTIONS.verbose then + + -- check + assert(msg) + + -- trace print(string.format(msg, ...)) end end -- the error function function utils.error(msg, ...) + + -- check + assert(msg) + + -- trace print("error: " .. string.format(msg, ...)) end -- the warning function function utils.warning(msg, ...) + + -- check + assert(msg) + + -- trace print("warning: " .. string.format(msg, ...)) end |
