Hi!
I've encountered a strange problem which I'd like to have some help with.
I'm building some software using Twisted and have encountered the following problem.
I use twistd 2.5.0 and starts the server using:
twistd pyom --logfile=x.log ...
Now, the tap file that is run by twistd loads and initiates modules dependent on the configuration. And these modules might load other modules.
So, what happens is that, depending (looks like it) on how complex the setup is, the redirect of stdout output for print to the logfile is not universally done.
Consistent but depending on the configuration, the output from print for one of modules continues to go to stdout instead of to the logfile.
Anyone got a clue as to what is happening and what I can do about it ?
-- Roland
On Wed, 2007-10-24 at 07:57 +0200, Roland Hedberg wrote:
Hi!
I've encountered a strange problem which I'd like to have some help with.
I'm building some software using Twisted and have encountered the following problem.
I use twistd 2.5.0 and starts the server using:
twistd pyom --logfile=x.log ...
Now, the tap file that is run by twistd loads and initiates modules dependent on the configuration. And these modules might load other modules.
So, what happens is that, depending (looks like it) on how complex the setup is, the redirect of stdout output for print to the logfile is not universally done.
I've never seen that.
Consistent but depending on the configuration, the output from print for one of modules continues to go to stdout instead of to the logfile.
Can you produce a minimal example showing the effect?
Anyone got a clue as to what is happening and what I can do about it ?
sed -i -e 's/print (.*)/log.msg(\1)/g' *.py
i.e. don't use "print" for logging.
-- Roland
Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
Phil Mayers wrote:
On Wed, 2007-10-24 at 07:57 +0200, Roland Hedberg wrote:
Consistent but depending on the configuration, the output from print for one of modules continues to go to stdout instead of to the logfile.
Can you produce a minimal example showing the effect?
I can try, but ...
Anyone got a clue as to what is happening and what I can do about it ?
sed -i -e 's/print (.*)/log.msg(\1)/g' *.py
i.e. don't use "print" for logging.
Doing this modification the problem went away.
Thanks Phil!
-- Roland