write log callback