Whenever a writ of habeas corpus is required in any action, suit or proceeding, civil or criminal, to which the state is a party, the application therefor may be made by the district attorney having charge thereof, and whenever so issued the court or judge shall state in the order of allowance that it was issued on such application.
ORS 34.350