[Twisted-Python] Logging to both console and file (using twisted logging API)?

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Thu Nov 5 07:29:24 EST 2009


On 08:59 am, namanvit at gmail.com wrote:
>People,
>
>Can anyone help me with this issue?
>
>log.startLogging(open(logname,'w')
>or
>log.startLogging(open(logname,'w'), setStdout=True)
>
>Both print the console output in the log. But nothing is displayed on
>console! So I get a empty console
>I would like to keep the console going also:
>
>Precisely:
>Console -> gets the print calls                             Not 
>Happening
>Log       -> gets the print calls + log.msg calls      Happening
>
>I understand that this might be a trivial issue, but I am not able to 
>figure
>it out in the documentation available :(

Asking the same thing over and over again isn't going to get you an 
answer.  Try making your question more clear.  I haven't answered 
because I don't understand what you're trying to achieve.

Jean-Paul



More information about the Twisted-Python mailing list