make logging a callback