Immediately after the return of the writ, the judge before whom the petitioner is brought shall examine the facts set forth in the return, the cause of the imprisonment or restraint, and whether the cause was upon commitment for a criminal charge or not.
Minn. Stat. § 589.12
(9750) RL s 4584; 1985 c 265 art 9 s 1