Fix a TypeError in logging