An ex officio judge shall not, directly or indirectly, be interested in the costs, or the compensation of an attorney or counsellor, in the court of which he is ex officio a judge.