summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-15 15:37:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-15 15:37:55 +0800
commitd23dc0b4ccf172230ac149bd3cc517b196aa14b3 (patch)
treeb2667e48af85956e78d1d43bbfc5a1cd663215bb /server
parentfe08a9909c1549cd3e0b19e5c773078a70044420 (diff)
downloadlua-language-server-d23dc0b4ccf172230ac149bd3cc517b196aa14b3.zip
避免生成过大的日志
Diffstat (limited to 'server')
-rw-r--r--server/src/service.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/service.lua b/server/src/service.lua
index 20e1a921..5deae2bb 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -48,7 +48,10 @@ function mt:_callMethod(name, params)
return res
else
local ok, r = pcall(table.dump, params)
- local dump = ok and r or 'Cyclic table'
+ local dump = ok and r or '<Cyclic table>'
+ if #dump > 10000 then
+ dump = '<Large table>'
+ end
log.debug(('Task [%s] failed, params: %s'):format(
name, dump
))