logging: add more terse .set()
This commit is contained in:
parent
33d6ecaa03
commit
0d06fb0c3c
11
logging.lua
11
logging.lua
@ -16,11 +16,18 @@ end
|
||||
-- default log level
|
||||
local loglevel="INFO"
|
||||
|
||||
function logging.setLogLevel(level)
|
||||
function logging.set(level)
|
||||
loglevel=loglevels[level] and level or loglevel
|
||||
end
|
||||
|
||||
logging.setLogLevel("INFO")
|
||||
---deprecated wrapper for logging.set, it is intentionally a wrapper instead of
|
||||
--an alias because LuaLS docs don't work without doing this
|
||||
---@deprecated user logging.set instead, more terse
|
||||
function logging.setLogLevel(level)
|
||||
return logging.set(level)
|
||||
end
|
||||
|
||||
logging.set("INFO")
|
||||
|
||||
local function printLog(severity, ...)
|
||||
if (loglevels[loglevel]) >= severity then
|
||||
|
Loading…
x
Reference in New Issue
Block a user