Logging refactor

Hey mate, refactored logging totally this time. Just close the other request.

Working example of what I was talking about earlier.

Cheers!