... if the dog was to attack your child (or any person) it it not legal to shoot the dog and you will be charged with animal cruelty...
I don't think there is a chance in Hades of that being correct. It is legal to shoot humans to protect yourself or others in most states.
"18-1-704. Use of physical force in defense of a person
Except as provided in subsections (2) and (3) of this section, a person is justified in using physical force upon another person in order to defend himself or a third person from what he reasonably believes to be the use of imminent use of unlawful physical force by that other person, and he may use a degree of force which he reasonably believes to be necessary for that purpose.
Deadly physical force may be used only if a person reasonably believes a lesser degree of force is inadequate and:
The actor has reasonable ground to believe and does believe, that he or another person is in imminent danger of being killed or of receiving great bodily injury" Sheriff's Office - Colorado Revised Statutes - Jefferson County, Colorado
I'm sure all shootings, dog & man, are reviewed to make sure they were valid.
If an angry Chihuahua is after you, shooting will get you in trouble. If it is a 200 lb Rottie who is after you, I'd bet the law will leave you alone. In any case, I'd use whatever force I thought needed to protect my family or myself.