Manage debug mode, and associated substate hints.
Set or change all the debug substate hints by calling the returned
module functable with no argument to reset to defaults; with
to set all substate hints into development mode, or
local _debug = require 'std._debug'(false)
Query substate hints by indexing the returned module functable keys:
local isstrict = _debug.strict
Beware that even though you can change std._debug state at any time, stdlib libraries in particular (but probably other clients too) are configured at load time according to the state at the time they are required - e.g. changing _debug.strict after require 'std' does not affect the strict environment already created for the 'std' module when it was previously loaded.
|__call ([enable])||Change the all builtin debug hints.|
|__index (name)||Lazy loading of std._debug modules.|
|Substates||Builtin debug substate hints.|
- __call ([enable])
Change the all builtin debug hints.
- enable bool or disable all debugging substate hints (optional)
-- Enable all debugging substates local _debug = require 'std._debug'(true)
- __index (name)
Lazy loading of std._debug modules.
Don't load everything on initial startup, wait until first attempt
to access a submodule, and then load it on demand.
- name string submodule name
table or nil
the submodule that was loaded to satisfy the missing
`name`, otherwise `nil` if nothing was found
local version = require 'std._debug'.version
Builtin debug substate hints.
__callmetamethod to set all substate hints at once. Note that none of the debugging features required to implement these hints are encoded here, this module is merely a central location to record systemwide hint; other modules you load subsequently may or may not choose to behave according to their content.
trueif runtime argument checking is desired (default true)
nilif deprecated api warnings are desired;
falseif deprecated apis without warnings are desired;
trueif removal of deprecated apis is preferred (optional)
- level int debugging level (default 1)
trueif strict enforcement of variable declaration before use is desired (default true)
require 'std._debug'.argcheck = false
- argcheck bool