close #137. Add a logger class for writing log to a file.