I'm migrating from using print() statements everywhere in my scripts to a more serious logging system. I'm using the logging module to manage the task. There's one thing I can't seem to achieve with it though:
In some cases, I want to create a log entry in two distinct steps, but recorded on the same line. Something that would classically look like this:
Initiating procedure... OK
In this case, the OK part would be recorded only if the task is successful.
I used to achieve that with the following print commands:
print('Initiating procedure... ', end="", flush=True)
...
print('OK')
Is there a way to achieve a similar thing with the logging module? Something like
logging.info("First message", end="", flush=True)
...
logging.info("OK")