4mix
amix at amix.dk
Wed Aug 18 18:15:12 EDT 2004
Hello To test out my applications I use unit-testing. In my opinion, that's the best way to test out a system. With unit-tests you don't need to look through logs to find out an error - - it simply tells you where the problem is. I simply use this class to get some information about objects. 4mix (http://amix.dk) ------------------------------------------------ What we do in life echoes in eternity Den 18/8-2004, kl. 13.53, skrev Kamil Niechajewicz: > On Tue, 17 Aug 2004 18:29:17 +0200 > Amir Salihefendic <amix at amix.dk> wrote: > >> I was pretty tired of the way that you test out stuff in mod_python. >> I.e. you use req.write(variable), req.write(dir(object)) etc. > > Isn't it better to write some logging class with log levels similar > to those of syslog for example? You write your debug output to that > file and read it immediately in the other console window.. > For example: > > logger = Log("/tmp/debug.log") > logger.logWARN("some special condition") > logger.logDEBUG("result: " + `some_variable`) > > and so on. > > Then you read the file using 'tail -f' for example, which immediately > shows you new lines from /tmp/debug.log file. I've found this method > extremely comfortable to use. > > You can write some disable/enable mechanism, so that you can later > do logger.setDebug(FALSE) to disable logging, which can affect > performance on production servers where there are a lot of processed > requests.. > > I think this is one of the best methods to debug web applications, > because it does not affect web page (like debugging using req.write() > which prints those values on the page) > > Best regards, > > /Kamil > _______________________________________________ > Mod_python mailing list > Mod_python at modpython.org > http://mailman.modpython.org/mailman/listinfo/mod_python >
|