add debug option to control debug logging