Log implemented with printMsg() function, based on print_time() by Mario Román