reduce logging unless debug flag is set