Changeset c155a16 in sasview for src/sas/sasgui/guiframe/proxy.py


Ignore:
Timestamp:
Apr 4, 2017 10:06:27 AM (7 years ago)
Author:
Ricardo Ferraz Leal <ricleal@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
463e7ffc
Parents:
6722fae
Message:

Logging is now logger

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/proxy.py

    rd85c194 rc155a16  
    66import logging 
    77import re 
     8 
     9 
     10logger = logging.getLogger() 
    811 
    912''' 
     
    7174        proxy_url_list = [] 
    7275        for this_pac_url in pac_urls_list: 
    73             logging.debug('Trying pac file (%s)...' % this_pac_url) 
     76            logger.debug('Trying pac file (%s)...' % this_pac_url) 
    7477            try: 
    7578                response = urllib2.urlopen( 
    7679                    this_pac_url, timeout=self.timeout) 
    77                 logging.debug('Succeeded (%s)...' % this_pac_url) 
     80                logger.debug('Succeeded (%s)...' % this_pac_url) 
    7881            except Exception: 
    79                 logging.debug('Failled (%s)...' % this_pac_url) 
     82                logger.debug('Failled (%s)...' % this_pac_url) 
    8083                continue 
    8184            pacStr = response.read() 
     
    120123        response = None 
    121124        try: 
    122             logging.debug("Trying Direct connection to %s..."%self.url) 
     125            logger.debug("Trying Direct connection to %s..."%self.url) 
    123126            response = urllib2.urlopen(req, timeout=self.timeout) 
    124127        except Exception, e: 
    125             logging.debug("Failed!") 
    126             logging.debug(e) 
     128            logger.debug("Failed!") 
     129            logger.debug(e) 
    127130            try: 
    128                 logging.debug("Trying to use system proxy if it exists...") 
     131                logger.debug("Trying to use system proxy if it exists...") 
    129132                self._set_proxy() 
    130133                response = urllib2.urlopen(req, timeout=self.timeout) 
    131134            except Exception, e: 
    132                 logging.debug("Failed!") 
    133                 logging.debug(e) 
     135                logger.debug("Failed!") 
     136                logger.debug(e) 
    134137                pac_urls = self._get_addresses_of_proxy_pac() 
    135138                proxy_urls = self._parse_proxy_pac(pac_urls) 
    136139                for proxy in proxy_urls: 
    137140                    try: 
    138                         logging.debug("Trying to use the proxy %s found in proxy.pac configuration"%proxy) 
     141                        logger.debug("Trying to use the proxy %s found in proxy.pac configuration"%proxy) 
    139142                        self._set_proxy(proxy) 
    140143                        response = urllib2.urlopen(req, timeout=self.timeout) 
    141144                    except Exception, e: 
    142                         logging.debug("Failed!") 
    143                         logging.debug(e) 
     145                        logger.debug("Failed!") 
     146                        logger.debug(e) 
    144147        if response is not None: 
    145             logging.debug("The connection to %s was successful."%self.url) 
     148            logger.debug("The connection to %s was successful."%self.url) 
    146149        else: 
    147             logging.warning("Connection to %s failed..."%self.url) 
     150            logger.warning("Connection to %s failed..."%self.url) 
    148151        return response 
    149152 
Note: See TracChangeset for help on using the changeset viewer.