timob-13916: should check the DBG flag in logInternal()