(b) Every commander of a guard, master at arms, warden, keeper or officer of a city or county jail or of any other jail, penitentiary or prison designated by the governor or by the adjutant general under section 130.11 of this article, to whose charge a prisoner is committed shall, within twenty-four hours after such commitment or as soon as he is relieved from guard, report to the commanding officer of the prisoner the name of such prisoner, the offense charged against him, and the name of the person who ordered or authorized the commitment.