I've read through Example 3.10 of Bruce Palka's text "An Introduction to Complex Function Theory" (p. 337). The example uses the residue theorem to compute where and .

Because of the contour he chose, he uses a holomorphic branch of the log function on but then proceeds to take limits and claims to compute the integral on the positive real axis, precisely where the branch that he chose is discontinuous. I'm confused; how can this be justified?