modified log file writes to improve speed.
Merge https://github.com/rnithyanand/fp-theory