Reading the discussion on LDK node, the format! macro allocates on the heap to create the strings. The Log::Dialog message is mostly useful for developers, but could be optimized away for a production application. This could either go behind a feature or a configuration that can be optimized way by the compiler.