Improved logging in main code

2 jobs for feature/improve_logging in 2 minutes and 44 seconds (queued for 55 seconds)