Pull out common debug handler functionality into function.
Pull out common debug handler functionality into function.

gconnell/stenographer,nbareil/stenographer,google/stenographer,google/stenographer,dcode/stenographer,nbareil/stenographer,dcode/stenographer,dcode/stenographer,google/stenographer,gconnell/stenographer,nbareil/stenographer,gconnell/stenographer