could anyone please help me regarding how to add a newline character to the log file created using logging module.
All the output is dumped onto a single line, which makes it unreadable. I s there any way to make the log file legible?
could anyone please help me regarding how to add a newline character to the log file created using logging module.
All the output is dumped onto a single line, which makes it unreadable. I s there any way to make the log file legible?
I usually prefer to do
filehandle.write('\n'.join(logline for logline in loglines))
You can also just add newline manualy at end of each line with normal addition notation.
filehandle.write(logline + '\n')
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.