diff options
| author | OpportunityLiu <[email protected]> | 2019-07-16 11:19:57 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-16 11:19:57 +0800 |
| commit | aba70a1655798c7441464fd03fb1867b723974d4 (patch) | |
| tree | f801b16d668d2b49548fb48369ea82fc98e9f7cc /xmake/core/base/utils.lua | |
| parent | d6be8e7effeca32a035ce89f1d02c28501b6a839 (diff) | |
improve dump
Diffstat (limited to 'xmake/core/base/utils.lua')
| -rw-r--r-- | xmake/core/base/utils.lua | 8 |
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 |
