Simplify the set_log_callback, it is better for thread safety