(a) The officer issuing the writ in vacation or the officer before whom it may be returned for trial shall have the same power to compel the attendance of witnesses or to punish a contempt of his or her authority, as a court of record has. His or her judgment on the trial of the writ shall be considered and be enforced as if it were a judgment of the court.
(b) At the discretion of the judge before whom the writ is returned, the affidavits of witnesses taken by either party, on reasonable notice to his or her agent or attorney, may be read as evidence on the trial of the return. However, no county judge or circuit judge shall hear or permit any evidence on the hearing or examination before him or her, other than the return to the writ, if the process or commitment shall appear regular on its face.