only log when there's something to log