[tor-commits] [tor/master] Extract log-granularity code into its own function.