Here it is, the latest version of the TradeLogIB written for Python 3.6+. It uses official IB Python API via an amazing ib_insync package:
https://github.com/stenri/TradeLogIB
Script is now more than two times shorter as ib_insync allows to use synchronous programming. So working with IB API becomes quite pleasurable.
NOTE: Output of this version differs slightly from previous version output because of differences in number rounding in the last field "Total Cost". If you account for this, the rest of the output is the same.