Improved output logging