diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-04-24 19:11:05 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-04-24 19:11:05 -0400 |
commit | 3b8821b7e6c00a34fe71b22f011841786bb9d7e5 (patch) | |
tree | d0216d50ede25086efe89aa41e9a4aeac07b1094 /forum/documentation/HOW_TO_DEBUG | |
parent | 9dac785a3416e3472a69155247ad5d5af58636db (diff) | |
download | askbot-3b8821b7e6c00a34fe71b22f011841786bb9d7e5.tar.gz askbot-3b8821b7e6c00a34fe71b22f011841786bb9d7e5.tar.bz2 askbot-3b8821b7e6c00a34fe71b22f011841786bb9d7e5.zip |
moved some files and directories inside forum from root
Diffstat (limited to 'forum/documentation/HOW_TO_DEBUG')
-rw-r--r-- | forum/documentation/HOW_TO_DEBUG | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/forum/documentation/HOW_TO_DEBUG b/forum/documentation/HOW_TO_DEBUG new file mode 100644 index 00000000..ba36198a --- /dev/null +++ b/forum/documentation/HOW_TO_DEBUG @@ -0,0 +1,39 @@ +1) LOGGING +Please remember that log files may contain plaintext passwords, etc. + +Please do not add print statements - at least do not commit them to git +because in some environments printing to stdout causes errors + +Instead use python logging this way: +-------------------------------- +#somewere on top of file +import logging + +#anywhere below +logging.debug('this maybe works') +logging.error('have big error!') +#or even +logging.debug('') #this will add time, line number, function and file record +#sometimes useful record for call tracing on its own +#etc - take a look at http://docs.python.org/library/logging.html +------------------------------- + +in OSQA logging is currently set up in settings_local.py.dist +please update it if you need - in older revs logging strings have less info + +messages of interest can be grepped out of the log file by module/file/function name +e.g. to take out all django_authopenid logs run: +>grep 'osqa\/django_authopenid' log/django.osqa.log | sed 's/^.*MSG: //' +in the example above 'sed' call truncates out a long prefix +and makes output look more meaningful + +2) DJANGO DEBUG TOOLBAR +osqa works with django debug toolbar +if debugging under apache server, check +that debug toolbar media is loaded correctly +if toolbar is enabled but you do not see it, possibly some Alias statement +in apache config is wrong in your VirtualHost or elsewhere + +3) If you discover new debugging techniques, please add here. +Possible areas to improve - at this point there is no SQL query logging, +as well as request data and http header. |