So after a lot of digging turns out the problem had nothing to do with the way the logger was implemented. The error was infact with the way my custom memory allocator was implemented which is why alloc::format!(...)
failed.
Thanks for everyone in the comments who helped me further refine the question.