Check if log_cb is not null before using log_cb callback