In all cases in which the defendant is charged with a misdemeanor offense, the defendant may appear by counsel only, although the court may require the personal attendance of the defendant at any time.