luadocs/content/lua.scripts.api.manual/dtutils.log/log_level.md
Bill Ferguson b69d752221 [lua scripts] created manual from script comments
[lua scripts api] created manual from embedded library documentation

[lua api] created stub to contain lua api manual
2020-12-12 15:14:19 -05:00

1.4 KiB

title id weight draft author
log_level log_level 40 false people

NAME

log_level

SYNOPSIS

get or set the log level

USAGE

local log = require "lib/log"
local result = log.log_level(...)

... - arguments - if none is supplied, then the current log level is returned as one of: log.debug, log.info, log.warn, log.error, log.success. If one of log.debug, log.info, log.warn, log.error, or log.success is supplied as the argument then the log level is set to that value. All log levels greater than or equal in value will be enabled. Any levels of lesser value will be disabled.

DESCRIPTION

log_level gets and sets the logging level. When called with no arguments the current log level is returned as one of log.debug, log.info, log.warn, log.error, or log.success. When called with one of log.debug, log.info, log.warn, log.error or log.success then the log level is set. When setting the log level all levels equal or greater are enabled and any of lesser value are disabled. See the example.

RETURN VALUE

result - log level - one of log.debug, log.info, log.warn, log.error or log.success

EXAMPLE

Assume that the current log level is log.error. Calling

log.log_level()

will return log.error. Calling

log.log_level(log.info) 

will leave log.debug disabled, and enable log.info, log.warn, log.error and log.success. log.info will be returned as the log_level.