Refactoring log to print date