summaryrefslogtreecommitdiff
path: root/xmake/scripts/base/utils.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-12-05 22:28:02 +0800
committerruki <[email protected]>2015-12-05 22:28:02 +0800
commit82fc443c84a02c7cf19248c5f9a70ef9f3a2032f (patch)
tree07189e5fefd41e23475c831d539d45e8b0e3af9c /xmake/scripts/base/utils.lua
parentf77eb028a770969a3e87af41e41fe1e66b3b7842 (diff)
impl add_files *.lib for windows
Diffstat (limited to 'xmake/scripts/base/utils.lua')
-rw-r--r--xmake/scripts/base/utils.lua21
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