Change log math for Python2.7 support