summaryrefslogtreecommitdiff
path: root/script/log.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-18 21:24:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-18 21:24:08 +0800
commit140dc03da4d8edb97a61e5ef45e92d391420fc39 (patch)
tree6952a853137be6498af80f23e5f2e4d1b489c994 /script/log.lua
parent769485b635de8b5ea0e37a25d4c8bc63cb256419 (diff)
downloadlua-language-server-140dc03da4d8edb97a61e5ef45e92d391420fc39.zip
print log
Diffstat (limited to 'script/log.lua')
-rw-r--r--script/log.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/script/log.lua b/script/log.lua
index 90de895a..507051ae 100644
--- a/script/log.lua
+++ b/script/log.lua
@@ -55,7 +55,13 @@ local function pushLog(level, ...)
str = str .. '\n' .. debugTraceBack(nil, 3)
end
local info = debugGetInfo(3, 'Sl')
- return m.raw(0, level, str, info.source, info.currentline, monotonic())
+ local text = m.raw(0, level, str, info.source, info.currentline, monotonic())
+
+ if log.print then
+ print(text)
+ end
+
+ return text
end
function m.info(...)