The court or judge shall proceed in a summary way to settle the facts by hearing the evidence and arguments, as well of all persons interested civilly, if any there be, as of the applicant and the person who holds him in custody, and shall dispose of the applicant as the case may require.
SDCL 21-27-14