summaryrefslogtreecommitdiff
path: root/xmake/core/base/utils.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-16 11:19:57 +0800
committerOpportunityLiu <[email protected]>2019-07-16 11:19:57 +0800
commitaba70a1655798c7441464fd03fb1867b723974d4 (patch)
treef801b16d668d2b49548fb48369ea82fc98e9f7cc /xmake/core/base/utils.lua
parentd6be8e7effeca32a035ce89f1d02c28501b6a839 (diff)
improve dump
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