Skip to main content

Module debug

Module debug 

Source
Expand description

Macros for logging and debug assertions. nice_dbg!(), nice_trace!(), and the nice_debug_assert_*!() macros are compiled out during release builds, so they can be used for asserting adiditonal invariants in debug builds. Check the nice_log!() macro for more information on nice-plug’s logger. None of the logging functions are realtime-safe, and you should avoid using them during release builds in any of the functions that may be called from an audio thread.

Macros§

nice_dbg
Analogues to the dbg!() macro, but respecting the NICE_LOG environment variable and with all of the same logging features as the other nice_*!() macros. Like the nice_debug_assert*!() macros, this is only shown when compiling in debug mode, but the macro will still return the value in non-debug modes.
nice_debug_assert
A debug_assert!() analogue that prints the error with line number information instead of panicking. During tests this is upgraded to a regular panicking debug_assert!().
nice_debug_assert_eq
A debug_assert_eq!() analogue that prints the error with line number information instead of panicking. See nice_debug_assert!() for more information.
nice_debug_assert_failure
An unconditional debug assertion failure, for if the condition has already been checked elsewhere. See nice_debug_assert!() for more information.
nice_debug_assert_ne
A debug_assert_ne!() analogue that prints the error with line number information instead of panicking. See nice_debug_assert!() for more information.
nice_error
Similar to nice_log!(), but more scream-y. Used for printing fatal errors.
nice_log
Write something to the logger. This defaults to STDERR unless the user is running Windows and a debugger has been attached, in which case OutputDebugString() will be used instead.
nice_trace
The same as nice_log!(), but with source and thread information. Like the nice_debug_assert*!() macros, this is only shown when compiling in debug mode.
nice_warn
Similar to nice_log!(), but less subtle. Used for printing warnings.