summaryrefslogtreecommitdiff
path: root/server-beta/src/brave/log.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-22 23:26:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-22 23:26:32 +0800
commitd0ff66c9abe9d6abbca12fd811e0c3cb69c1033a (patch)
treebb34518d70b85de7656dbdbe958dfa221a3ff3b3 /server-beta/src/brave/log.lua
parent0a2c2ad15e1ec359171fb0dd4c72e57c5b66e9ba (diff)
downloadlua-language-server-d0ff66c9abe9d6abbca12fd811e0c3cb69c1033a.zip
整理一下目录结构
Diffstat (limited to 'server-beta/src/brave/log.lua')
-rw-r--r--server-beta/src/brave/log.lua52
1 files changed, 0 insertions, 52 deletions
diff --git a/server-beta/src/brave/log.lua b/server-beta/src/brave/log.lua
deleted file mode 100644
index cd27cd55..00000000
--- a/server-beta/src/brave/log.lua
+++ /dev/null
@@ -1,52 +0,0 @@
-local brave = require 'brave'
-
-local tablePack = table.pack
-local tostring = tostring
-local tableConcat = table.concat
-local debugTraceBack = debug.traceback
-local debugGetInfo = debug.getinfo
-
-_ENV = nil
-
-local function pushLog(level, ...)
- local t = tablePack(...)
- for i = 1, t.n do
- t[i] = tostring(t[i])
- end
- local str = tableConcat(t, '\t', 1, t.n)
- if level == 'error' then
- str = str .. '\n' .. debugTraceBack(nil, 3)
- end
- local info = debugGetInfo(3, 'Sl')
- brave.push('log', {
- level = level,
- msg = str,
- src = info.source,
- line = info.currentline,
- })
- return str
-end
-
-local m = {}
-
-function m.info(...)
- pushLog('info', ...)
-end
-
-function m.debug(...)
- pushLog('debug', ...)
-end
-
-function m.trace(...)
- pushLog('trace', ...)
-end
-
-function m.warn(...)
- pushLog('warn', ...)
-end
-
-function m.error(...)
- pushLog('error', ...)
-end
-
-return m