Added better logging with different logging levels