Adding encapsulation for logging and getting the current time (for logging)