The judge before whom any person is brought upon charge of having made threats, shall immediately examine the complainant and witnesses in support of the prosecution, on oath, in the presence of the party charged, in relation to any matters pertinent to the charge. Witnesses for the prisoner, if the prisoner has any, shall be subsequently sworn and examined. The prisoner may be assisted by counsel in the proceeding.