Fork with minor tweaks from https://code.google.com/p/log4go/