How can I write to the previous line in a log file using Python's Logging module?
Posted
by turvyc
on Stack Overflow
See other posts from Stack Overflow
or by turvyc
Published on 2010-05-15T11:30:03Z
Indexed on
2010/05/15
11:34 UTC
Read the original article
Hit count: 182
Hi all, long-time lurker here, finally emerging from the woodwork.
Essentially, what I'm trying to do is have my logger write data like this to the logfile:
Connecting to database . . . Done.
I'd like the 'Connecting to database . . . ' to be written when the function is called, and the 'Done' written after the function has successfully executed.
I'm using Python 2.6 and the logging module. Also, I'd really like to avoid using decorators for this. Any help would be most appreciated!
© Stack Overflow or respective owner