rewrote logging to accommodate modified subprocess usage.