use logging system, accept --debug flag