(a) If the defendant is committed to jail and the application for bail is made to a judge or magistrate during vacation, it must be by written petition signed by the defendant or his or her counsel briefly stating the offense for which he or she is committed and naming the persons offered as surety.
(b) In all other cases, the application may be made orally to the judge or magistrate.