ORS 34.580
Inquiry into cause of imprisonment
The court or judge before whom the party is brought on the writ shall, immediately after the return thereof, proceed to examine into the facts contained in the return, and into the cause of the imprisonment or restraint of such party.