fix default param bug; make logging configurable