Adding support for logging if no logger is set.