It seems like you're using std::endl instead of \n here which includes an implicit flush and then doing a flush a couple of lines below for critical log entries. I'm guessing this use of std::endl was unintentional otherwise the flushing of the critical log entries is entirely pointless because you're flushing every single line already.
It seems like you're using std::endl instead of \n here which includes an implicit flush and then doing a flush a couple of lines below for critical log entries. I'm guessing this use of std::endl was unintentional otherwise the flushing of the critical log entries is entirely pointless because you're flushing every single line already.