added callback to log
added option for callback to log