Thanks. that does the job for me very well.<br><br><div class="gmail_quote">On Thu, Nov 5, 2009 at 7:18 PM, <span dir="ltr"><<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On 01:20 pm, <a href="mailto:namanvit@gmail.com">namanvit@gmail.com</a> wrote:<br>
>I ll try to rephrase it better:<br>
><br>
>I simply want the print statement to appear in both the log file and<br>
>the<br>
>console.<br>
>print("goes in both") -> the log also gets this and the console also.<br>
><br>
>Thanks<br>
<br>
</div>How about installing two log observers?<br>
<br>
from sys import stdout<br>
from twisted.python.log import FileLogObserver, startLogging,<br>
addObserver, msg<br>
<br>
# First, startLogging to capture stdout<br>
startLogging(stdout)<br>
<br>
# Now add an observer that logs to a file<br>
addObserver(FileLogObserver(file("foo.log")).emit)<br>
<br>
msg("Hello, world")<br>
print "Goodbye, world"<br>
<div><div></div><div class="h5"><br>
Jean-Paul<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br>