added conditions on display of logging to console