Add missing subprocess module and fix logging usage