Format metric logging more consistently on Python 2.6.