class
Logbuch::Configuration
- Logbuch::Configuration
- Reference
- Object
Overview
The receiver of the block Logbuch.configure runs, which changes the
settings it names and leaves the others as they are.
Logbuch.configure do
max_depth 3
max_length 256, env: false
end
Each setting has an environment variable, such as LOGBUCH_MAX_DEPTH,
which overrides the value set here; use_env false, or env: false on
one setter, switches that off. A program built with -Dlogbuch=off only
type-checks the block and keeps the defaults.
Defined in:
logbuch/settings.crInstance Method Summary
-
#max_cap(value : Int, *, env : Bool | Nil = nil) : Nil
Sets
Settings#max_cap, from 0 toUInt32::MAX, and switchesLOGBUCH_MAX_CAPlike#max_depth. -
#max_depth(value : Int, *, env : Bool | Nil = nil) : Nil
Sets
Settings#max_depth, from 0 toDEPTH_CEILING. -
#max_length(value : Int, *, env : Bool | Nil = nil) : Nil
Sets
Settings#max_length, from 0 toUInt32::MAX, and switchesLOGBUCH_MAX_LENGTHlike#max_depth. -
#use_env(enabled : Bool) : Nil
Whether the settings read their environment variables:
use_env falsemakes every setting ignore its variable, also one applied already, anduse_env truereads them again, except where a setter saidenv: false.
Instance methods inherited from class Reference
inspect(io : IO) : Nil
inspect
Instance methods inherited from class Object
to_trace(tracer : Logbuch::Tracer) : Log::Metadata::Value
to_trace
Instance Method Detail
Sets Settings#max_cap, from 0 to UInt32::MAX, and switches
LOGBUCH_MAX_CAP like #max_depth.
Sets Settings#max_depth, from 0 to DEPTH_CEILING. env: false makes
it ignore LOGBUCH_MAX_DEPTH, and env: true makes it read that again.
Takes any integer type, such as an Int32 variable, and raises
ArgumentError for a value out of range, a negative one included.
Sets Settings#max_length, from 0 to UInt32::MAX, and switches
LOGBUCH_MAX_LENGTH like #max_depth.
Whether the settings read their environment variables: use_env false
makes every setting ignore its variable, also one applied already, and
use_env true reads them again, except where a setter said env: false.