Ashaironix wrote: other case at trhe same time logs it
Right there is your main problem. In 95% of the applications I do, the logger has to be a separate process. You can just have your consumer loop enqueue data for your logger. Logging to disk just tends to be slow, so it really should be separate for that reason alone.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5