I have the following code:
np.set_printoptions(formatter={'float': '{: 0.2f}'.format})
logging.info(f"Metric: {metric:.4f} from params: {x}")
That produces the following output. The line break just before the last parameter drives me crazy:
INFO:root:Metric: 6.1811 from params: [ 4.04 ... -0.00
0.02]
INFO:root:Metric: 6.1811 from params: [ 4.04 ... -0.00
0.02]
This is what I tried to prevent line wrapping:
handler = logging.StreamHandler()
handler.width = 160
logging.basicConfig(level=logging.INFO, handlers=[handler])
However, this did not have any effect. Do you have any suggestions?