No judge or justice shall preside in the trial of any cause in the event of which he may be interested, or where either of the parties shall be connected with him by consanguinity or affinity, within such degree as may be prescribed by law; or in which he may have been of counsel or have presided in any inferior court.