module Debug
Defined in:
debug.crdebug/core_ext/kernel.cr
debug/logger.cr
debug/settings.cr
debug/version.cr
Constant Summary
-
ACTIVE =
{{ (env("DEBUG")) == "1" }} -
Whether
debug!support was compiled in (DEBUG=1at compile time). -
VERSION =
{{ (`shards version \"/srv/crystaldoc.info/github-Sija-debug.cr-v2.1.0/src/debug\"`).chomp.stringify }}
Class Method Summary
- .configure(&) : Nil
-
.enabled=(enabled : Bool | Nil)
Explicitly enables or disables
debug!output at runtime; set tonilto fall back to checking theDEBUGENV variable. - .enabled? : Bool
-
.log_builder : Log::Builder
Builder used for the
Debug.logger, kept separate from the globalLog.builder, so thatdebug!output is neither duplicated by bindings set up by the application (like the default one, set viaLog.setup_from_env), nor lost afterLog.setupis called. - .logger : Log
- .logger=(logger : Log)
- .settings
Macro Summary
Class Method Detail
Explicitly enables or disables debug! output at runtime;
set to nil to fall back to checking the DEBUG ENV variable.
Builder used for the Debug.logger, kept separate from the global
Log.builder, so that debug! output is neither duplicated by bindings
set up by the application (like the default one, set via
Log.setup_from_env), nor lost after Log.setup is called.
Use it to capture debug! output in specs:
Log.capture(builder: Debug.log_builder) do |logs|
debug!(:foo)
logs.check(:debug, /foo/)
end