summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-15 19:45:25 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-15 19:45:25 +0800
commit8a519ff707b621460227516383a11674c5d2e406 (patch)
tree9dc9faf21e957fc23ae3aa13dcdbc25f9871b918
parent491876016134b50680667053177faeae411aa9a2 (diff)
downloadlua-language-server-8a519ff707b621460227516383a11674c5d2e406.zip
cleanup
-rw-r--r--main.lua4
-rw-r--r--script/log.lua9
2 files changed, 7 insertions, 6 deletions
diff --git a/main.lua b/main.lua
index f61b0e32..e26b6cbf 100644
--- a/main.lua
+++ b/main.lua
@@ -52,8 +52,8 @@ METAPATH = METAPATH and util.expandPath(METAPATH) or (ROOT:string() .. '/meta')
---@diagnostic disable-next-line: deprecated
debug.setcstacklimit(200)
---collectgarbage('generational', 5, 25)
-collectgarbage('incremental', 120, 120, 0)
+collectgarbage('generational', 10, 50)
+--collectgarbage('incremental', 120, 120, 0)
---@diagnostic disable-next-line: lowercase-global
log = require 'log'
diff --git a/script/log.lua b/script/log.lua
index 2076348c..597bdc4e 100644
--- a/script/log.lua
+++ b/script/log.lua
@@ -65,10 +65,6 @@ local function pushLog(level, ...)
local info = debugGetInfo(3, 'Sl')
local text = m.raw(0, level, str, info.source, info.currentline, monotonic())
- if log.print then
- print(text)
- end
-
return text
end
@@ -127,6 +123,11 @@ function m.raw(thd, level, msg, source, currentline, clock)
m.file:write(buf)
end
end
+
+ if log.print then
+ print(buf)
+ end
+
return buf
end