Moved diagnostic loggin to own module