When such person appears, if the judge, on hearing the parties, considers that there is not good cause for the complaint, he shall discharge such person, and may give judgment in his favor against the complainant for his costs. If he considers that there is good cause therefor, he may require a recognizance of the person against whom it is, and give judgment against him for the costs of the prosecution, or any part thereof; and, unless such recognizance be given, he shall commit him to jail by a warrant, stating the sum and time in and for which the recognizance is directed. The person given judgment under this section for costs may issue a writ of fieri facias thereon, if an appeal be not allowed; and proceedings thereupon may be according to §§ 16.1-99 through 16.1-101.
Va. Code § 19.2-21