Preemption can also result in re-entrancy. How to deal with it? Assuming single-core systems there are two approaches:
Disable interrupts in
acquire; re-enable them in
release. This means that the logging macros block higher priority interrupts.
Have a separate logger per priority level.
releaseare now lock-free and don't block interrupts. This requires multiplexing in the transport.