Added timestamp and check if debug is enabled