Provides a flexible assertion support, related to a debug level.
Provides a flexible assertion support, related to a debug level.
DEBUG_LEVEL == 1, should be suitable for a release version of the software, with inexpensive sanity checks.
DEBUG_LEVEL 2 and 3, encompass more expensive sanity checks that should only be made in debug mode.
DEBUG_LEVEL 4 is reserved to very expensive computation that should never be used except beside development.
Default debug level is 3 when java assertions are enabled (VM option "-ea") and 1 otherwise.
All assert methods have lazy evaluation of the all parameters, so invocation should be almost for free when above
the current DEBUG_LEVEL.
Assertion can be remove at compile time with "-Xelide-below" parameter to scalac.
Provides a flexible assertion support, related to a debug level.
DEBUG_LEVEL == 1, should be suitable for a release version of the software, with inexpensive sanity checks. DEBUG_LEVEL 2 and 3, encompass more expensive sanity checks that should only be made in debug mode. DEBUG_LEVEL 4 is reserved to very expensive computation that should never be used except beside development.
Default debug level is 3 when java assertions are enabled (VM option "-ea") and 1 otherwise.
All assert methods have lazy evaluation of the all parameters, so invocation should be almost for free when above the current DEBUG_LEVEL.
Assertion can be remove at compile time with "-Xelide-below" parameter to scalac.