A logger for the log crate made specifically to cater to the needs of the NIH-plug plugin framework.
OutputDebugString()
function. This check is performed at runtime to accommodate debuggers being
attached to already running processes.The log's output target can be changed by setting the NIH_LOG
environment
variable:
stderr
causes the log to be printed to STDERR.windbg
causes the log to be output to the Windows debugger.The latter two options are useful on Windows where accessing the standard IO streams may be difficult.
If NIH_LOG
is not set, then a dynamic logging output target is used instead.
On Windows this causes log messages to be sent to the Windows debugger when
one is attached. This check is done just before printing the message to make
it possible to attach a debugger to a running process. When the debugger is
not attached the output goes directly to STDERR. On non-Windows platforms
STDERR is always used.
NIH_LOG
was set explicitly, then this is honored and the regular
behavior won't be overridden.assert_no_alloc
when
performing debug prints from a realtime context.