Improve logging

I always wanted this but never thought it was gonna be an easy way to do this. Thanks :)