New logger

Try this. I couldn't find any modules that did exactly what I wanted, so I would have had to customise them with about this many lines of code anyway.