CGI + Python + print errors?
I am working on web page with python and I''d like all errors and warningto be printed to the page to see it immideately. How can I do this?
import syssys.stderr = sys.stdout
Note that CGI protocols mandate that you do this.
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
er, I''m not so sure about this being mandated. In fact, i think things that are printed to stderr can be routed into an error log automatically by apache.
Frunay is teh mast0r of teh Pyth0n.
Teh omg.
________________
Fatal Frog Entertainment (FFE): My solo company in progress.
Teh omg.
________________
Fatal Frog Entertainment (FFE): My solo company in progress.
_________________Politics is the ability to foretell what is going to happen tomorrow, next week, next month and next year. And to have the ability afterwards to explain why it didn't happen. -- Winston ChurchillGDNet-0.2 - rate users the easy way with this nifty Firefox extension. Updated with new features.
quote:
Original post by C-Junkie
er, I''m not so sure about this being mandated. In fact, i think things that are printed to stderr can be routed into an error log automatically by apache.
They are, by default. I wouldn''t do the stdout = stderr.
--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote:
Original post by Arild Fines
They are, by default. I wouldn't do the stdout = stderr.
Messages on stderr are intended for the server logs, this is incorrect behaviour.
edit: Which is probably a fix for incorrect CGI scripts.
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
[edited by - Fruny on October 31, 2003 2:47:26 PM]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement