summaryrefslogtreecommitdiff
path: root/xmake/core/base/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/base/utils.lua')
-rw-r--r--xmake/core/base/utils.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/core/base/utils.lua b/xmake/core/base/utils.lua
index d8f1ec7c2..5b0c68a5e 100644
--- a/xmake/core/base/utils.lua
+++ b/xmake/core/base/utils.lua
@@ -35,8 +35,10 @@ function utils.dump(...)
return ...
end
+ local diagnosis = option.get("diagnosis")
+
-- show caller info
- if option.get("diagnosis") then
+ if diagnosis then
local info = debug.getinfo(2)
local line = info.currentline
if not line or line < 0 then line = info.linedefined end
@@ -58,11 +60,11 @@ function utils.dump(...)
end
if values_count == 1 then
- dump(values[1], indent or "")
+ dump(values[1], indent or "", diagnosis)
io.write("\n")
else
for i = 1, values_count do
- dump(values[i], indent or string.format("%2d: ", i))
+ dump(values[i], indent or string.format("%2d: ", i), diagnosis)
io.write("\n")
end
end