The Loyalty Quandary: At what point would you turn your friend in?

How bad a crime would a friend have to commit for you to turn them in for it? How about if the criminal was your spouse, your parent, or your child? Where do you draw the line between personal loyalty and loyalty to your fellow citizens and to the law?