[SQL] Better logging when applying rules.

Author: Michael Armbrust <michael@databricks.com>

Closes #616 from marmbrus/ruleLogging and squashes the following commits:

39c09fe [Michael Armbrust] Fix off by one error.
5af3537 [Michael Armbrust] Better logging when applying rules.

(cherry picked from commit b295714708476b2904e205ac6dc58867e205546e)
Signed-off-by: Reynold Xin <rxin@apache.org>