log_buff function added.