summaryrefslogtreecommitdiff
path: root/pypers/wsgi/thread_log.py
blob: 850f221e88b9e0566fa1c487c19c70ee23717471 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import logging, threading, sys

class C(object):
    def __init__(self):
        print threading.currentThread()
    def __del__(self):
        logger.warn('%s deleted %r' % (threading.currentThread(), self))
        
if __name__ == '__main__':
    logger = logging.getLogger()
    logger.basicConfig(file='/tmp/x.log')
    c = C()