7bf5fab1fa2fa07cc012c0570781aea23343ae05bcca862eaaeeb4e5a739a9107f8ae073ef6a37b3
21
################################################################################
21
################################################################################
22
from __future__ import with_statement
22
from __future__ import with_statement
23
from pylons import config
23
from pylons import config
24
import pytz, os
24
import pytz, os, logging, sys
25
from datetime import timedelta
25
from datetime import timedelta
26
from r2.lib.cache import LocalCache, Memcache, CacheChain
26
from r2.lib.cache import LocalCache, Memcache, CacheChain
27
from r2.lib.db.stats import QueryStats
27
from r2.lib.db.stats import QueryStats
...
 
...
 
146
                    full_name = os.path.join(log_path, fname)
146
                    full_name = os.path.join(log_path, fname)
147
                    os.remove(full_name)
147
                    os.remove(full_name)
148
 
148
 
 
 
149
        #setup the logger
 
 
150
        self.log = logging.getLogger('reddit')
 
 
151
        if self.debug:
 
 
152
            self.log.setLevel(logging.DEBUG)
 
 
153
            self.log.addHandler(logging.StreamHandler())
 
 
154
 
149
    def __del__(self):
155
    def __del__(self):
150
        """
156
        """
151
        Put any cleanup code to be run when the application finally exits 
157
        Put any cleanup code to be run when the application finally exits 
152
        here.
158
        here.
153
        """
159
        """
154
        pass
160
        pass
 
 
161