add a logging flag defaulted to false