So far I have used the following code to save logs of infeasible constraints in a string:
print(\'Logged infeasible constraints:\', file=buffer)