Index: run.py
===================================================================
--- run.py	(revision 64ca561b6b264f63b4d7d09a6582f1f3330ae720)
+++ run.py	(revision f36e01fa1b9b521d3f7496b637e33bed18626df2)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
 #!/usr/bin/env python
+
 """
 Run sasview in place.  This allows sasview to use the python
@@ -14,27 +16,12 @@
 """
 
+import imp
 import os
 import sys
-import imp
-import logging
-import logging.config
-
 from contextlib import contextmanager
-from os.path import abspath, dirname, join as joinpath
+from os.path import join as joinpath
+from os.path import abspath, dirname
 
 
-LOGGER_CONFIG_FILE = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'sasview/logging.ini')
-logging.config.fileConfig(LOGGER_CONFIG_FILE, disable_existing_loggers=True)
-logger = logging.getLogger(__name__)
-
-def update_all_logs_to_debug(logger):
-    '''
-    This updates all loggers and respective handlers to DEBUG
-    '''
-    for handler in logger.handlers or logger.parent.handlers:
-        handler.setLevel(logging.DEBUG)
-    for name,_ in logging.Logger.manager.loggerDict.items():
-        logging.getLogger(name).setLevel(logging.DEBUG)
-        
 def addpath(path):
     """
@@ -50,4 +37,5 @@
     sys.path.insert(0, path)
 
+
 @contextmanager
 def cd(path):
@@ -60,10 +48,12 @@
     os.chdir(old_dir)
 
+
 def import_package(modname, path):
     """Import a package into a particular point in the python namespace"""
-    mod = imp.load_source(modname, abspath(joinpath(path,'__init__.py')))
+    mod = imp.load_source(modname, abspath(joinpath(path, '__init__.py')))
     sys.modules[modname] = mod
     mod.__path__ = [abspath(path)]
     return mod
+
 
 def import_dll(modname, build_path):
@@ -72,7 +62,8 @@
     ext = sysconfig.get_config_var('SO')
     # build_path comes from context
-    path = joinpath(build_path, *modname.split('.'))+ext
-    #print "importing", modname, "from", path
+    path = joinpath(build_path, *modname.split('.')) + ext
+    # print "importing", modname, "from", path
     return imp.load_dynamic(modname, path)
+
 
 def prepare():
@@ -86,6 +77,6 @@
     from distutils.util import get_platform
     root = abspath(dirname(__file__))
-    platform = '%s-%s'%(get_platform(),sys.version[:3])
-    build_path = joinpath(root, 'build','lib.'+platform)
+    platform = '%s-%s' % (get_platform(), sys.version[:3])
+    build_path = joinpath(root, 'build', 'lib.' + platform)
 
     # Notify the help menu that the Sphinx documentation is in a different
@@ -98,13 +89,17 @@
     #if not os.path.exists(mplconfig): os.mkdir(mplconfig)
     #import matplotlib
-    #matplotlib.use('Agg')
-    #print matplotlib.__file__
+    # matplotlib.use('Agg')
+    # print matplotlib.__file__
     #import pylab; pylab.hold(False)
     # add periodictable to the path
-    try: import periodictable
-    except: addpath(joinpath(root, '..','periodictable'))
+    try:
+        import periodictable
+    except:
+        addpath(joinpath(root, '..', 'periodictable'))
 
-    try: import bumps
-    except: addpath(joinpath(root, '..','bumps'))
+    try:
+        import bumps
+    except:
+        addpath(joinpath(root, '..', 'bumps'))
 
     # select wx version
@@ -126,5 +121,5 @@
     # be better to just store the package in src/sas/sasview.
     import sas
-    sas.sasview = import_package('sas.sasview', joinpath(root,'sasview'))
+    sas.sasview = import_package('sas.sasview', joinpath(root, 'sasview'))
 
     # The sas.models package Compiled Model files should be pulled in from the build directory even though
@@ -135,5 +130,5 @@
     import sas.sascalc.pr
     sas.sascalc.pr.core = import_package('sas.sascalc.pr.core',
-                                  joinpath(build_path, 'sas', 'sascalc', 'pr', 'core'))
+                                         joinpath(build_path, 'sas', 'sascalc', 'pr', 'core'))
 
     # Compiled modules need to be pulled from the build directory.
@@ -141,5 +136,5 @@
     import sas.sascalc.file_converter
     sas.sascalc.file_converter.core = import_package('sas.sascalc.file_converter.core',
-                                  joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core'))                    
+                                                     joinpath(build_path, 'sas', 'sascalc', 'file_converter', 'core'))
 
     # Compiled modules need to be pulled from the build directory.
@@ -147,14 +142,22 @@
     import sas.sascalc.calculator
     sas.sascalc.calculator.core = import_package('sas.sascalc.calculator.core',
-                                  joinpath(build_path, 'sas', 'sascalc', 'calculator', 'core'))
+                                                 joinpath(build_path, 'sas', 'sascalc', 'calculator', 'core'))
 
     sys.path.append(build_path)
 
-    #print "\n".join(sys.path)
+    # print "\n".join(sys.path)
+
 
 if __name__ == "__main__":
-    update_all_logs_to_debug(logger)
+    # Need to add absolute path before actual prepare call,
+    # so logging can be done during initialization process too
+    root = abspath(dirname(__file__))
+    addpath(joinpath(root, 'sasview'))
+    from logger_config import SetupLogger
+    logger = SetupLogger(__name__).config_development()
+
+    logger.debug("Starting SASVIEW in debug mode.")
     prepare()
     from sas.sasview.sasview import run
     run()
-    
+    logger.debug("Ending SASVIEW in debug mode.")
Index: sasview/logger_config.py
===================================================================
--- sasview/logger_config.py	(revision f36e01fa1b9b521d3f7496b637e33bed18626df2)
+++ sasview/logger_config.py	(revision f36e01fa1b9b521d3f7496b637e33bed18626df2)
@@ -0,0 +1,83 @@
+from __future__ import print_function
+
+import logging
+import logging.config
+import os
+import os.path
+
+import pkg_resources
+
+
+'''
+Module that manages the global logging
+'''
+
+
+class SetupLogger(object):
+    '''
+    Called at the beginning of run.py or sasview.py
+    '''
+
+    def __init__(self, logger_name):
+        self._find_config_file()
+        self.name = logger_name
+
+    def config_production(self):
+        logger = logging.getLogger(self.name)
+        if not logger.root.handlers:
+            self._read_config_file()
+            logging.captureWarnings(True)
+            logger = logging.getLogger(self.name)
+        return logger
+
+    def config_development(self):
+        '''
+        '''
+        self._read_config_file()
+        logger = logging.getLogger(self.name)
+        self._update_all_logs_to_debug(logger)
+        logging.captureWarnings(True)
+        return logger
+
+    def _read_config_file(self):
+        if self.config_file is not None:
+            logging.config.fileConfig(self.config_file)
+
+    def _update_all_logs_to_debug(self, logger):
+        '''
+        This updates all loggers and respective handlers to DEBUG
+        '''
+        for handler in logger.handlers or logger.parent.handlers:
+            handler.setLevel(logging.DEBUG)
+        for name, _ in logging.Logger.manager.loggerDict.items():
+            logging.getLogger(name).setLevel(logging.DEBUG)
+
+    def _find_config_file(self, filename="logging.ini"):
+        '''
+        The config file is in:
+        Debug ./sasview/
+        Packaging: sas/sasview/
+        Packaging / production does not work well with absolute paths
+        thus the multiple paths below
+        '''
+        places_to_look_for_conf_file = [
+            os.path.join(os.path.abspath(os.path.dirname(__file__)), filename),
+            filename,
+            os.path.join("sas", "sasview", filename),
+            os.path.join(os.getcwd(), "sas", "sasview", filename),
+        ]
+
+        # To avoid the exception in OSx
+        # NotImplementedError: resource_filename() only supported for .egg, not .zip
+        try:
+            places_to_look_for_conf_file.append(
+                pkg_resources.resource_filename(__name__, filename))
+        except NotImplementedError:
+            pass
+
+        for filepath in places_to_look_for_conf_file:
+            if os.path.exists(filepath):
+                self.config_file = filepath
+                return
+        print("ERROR: Logging.ini not found...")
+        self.config_file = None
Index: sasview/logging.ini
===================================================================
--- sasview/logging.ini	(revision 64ca561b6b264f63b4d7d09a6582f1f3330ae720)
+++ sasview/logging.ini	(revision fc22533c01ad2a6c8b1c6b4a0fb67c15c527405d)
@@ -16,5 +16,6 @@
 
 [formatter_detailed]
-format=%(asctime)s:%(name)s:%(levelname)s: %(lineno)d: %(message)s
+#format=%(asctime)s : %(levelname)s : %(name)s: %(lineno)d: %(message)s
+format=%(asctime)s : %(levelname)s : %(name)s (%(filename)s:%(lineno)s) :: %(message)s
 
 ###############################################################################
@@ -27,10 +28,10 @@
 class=logging.StreamHandler
 formatter=simple
-level=INFO
+level=WARNING
 args=tuple()
 
 [handler_log_file]
 class=logging.FileHandler
-level=INFO
+level=DEBUG
 formatter=detailed
 args=(os.path.join(os.path.expanduser("~"),'sasview.log'),"a")
@@ -43,5 +44,5 @@
 
 [logger_root]
-level=INFO
+level=DEBUG
 formatter=default
 handlers=console,log_file
@@ -60,5 +61,5 @@
 
 [logger_sasgui]
-level=INFO
+level=DEBUG
 qualname=sas.sasgui
 handlers=console,log_file
Index: sasview/sasview.py
===================================================================
--- sasview/sasview.py	(revision 3608cd114aaf5142818c85b33f8f32323c34e481)
+++ sasview/sasview.py	(revision f36e01fa1b9b521d3f7496b637e33bed18626df2)
@@ -1,25 +1,24 @@
+# -*- coding: utf-8 -*-
 """
 Base module for loading and running the main SasView application.
 """
 ################################################################################
-#This software was developed by the University of Tennessee as part of the
-#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
-#project funded by the US National Science Foundation.
+# This software was developed by the University of Tennessee as part of the
+# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+# project funded by the US National Science Foundation.
 #
-#See the license text in license.txt
+# See the license text in license.txt
 #
-#copyright 2009, University of Tennessee
+# copyright 2009, University of Tennessee
 ################################################################################
 import os
+import os.path
 import sys
-import logging
-import logging.config
 import traceback
 
-logger = logging.getLogger(__name__)
-if not logger.root.handlers:
-    LOGGER_CONFIG_FILE = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'logging.ini')
-    logging.config.fileConfig(LOGGER_CONFIG_FILE, disable_existing_loggers=False)
-    logging.captureWarnings(True)
+from sas.sasview.logger_config import SetupLogger
+
+logger = SetupLogger(__name__).config_production()
+
 
 # Log the start of the session
@@ -55,9 +54,9 @@
 import wxcruft
 wxcruft.call_later_fix()
-#wxcruft.trace_new_id()
+# wxcruft.trace_new_id()
 
-#Always use private .matplotlib setup to avoid conflicts with other
-#uses of matplotlib
-#Have to check if .sasview exists first
+# Always use private .matplotlib setup to avoid conflicts with other
+# uses of matplotlib
+# Have to check if .sasview exists first
 sasdir = os.path.join(os.path.expanduser("~"),'.sasview')
 if not os.path.exists(sasdir):
@@ -72,6 +71,5 @@
 from sas.sasgui.guiframe.gui_style import GUIFRAME
 from welcome_panel import WelcomePanel
-# For py2exe, import config here
-import local_config
+
 PLUGIN_MODEL_DIR = 'plugin_models'
 APP_NAME = 'SasView'
@@ -87,5 +85,5 @@
         """
         """
-        #from gui_manager import ViewApp
+        # from gui_manager import ViewApp
         self.gui = gui_manager.SasViewApp(0)
         # Set the application manager for the GUI
@@ -116,5 +114,5 @@
             logger.error(traceback.format_exc())
 
-        #Invariant perspective
+        # Invariant perspective
         try:
             import sas.sasgui.perspectives.invariant as module
@@ -134,5 +132,5 @@
             logger.error("Unable to load corfunc module")
 
-        #Calculator perspective
+        # Calculator perspective
         try:
             import sas.sasgui.perspectives.calculator as module
@@ -153,5 +151,4 @@
                                                         APP_NAME)
             logger.error(traceback.format_exc())
-
 
         # Add welcome page
@@ -174,5 +171,5 @@
     if len(sys.argv) > 1:
         ## Run sasview as an interactive python interpreter
-        #if sys.argv[1] == "-i":
+        # if sys.argv[1] == "-i":
         #    sys.argv = ["ipython", "--pylab"]
         #    from IPython import start_ipython
@@ -188,4 +185,5 @@
         SasView()
 
+
 if __name__ == "__main__":
     run()
Index: sasview/setup_exe.py
===================================================================
--- sasview/setup_exe.py	(revision 8b645cc3cea24d016ee884edc83b7654f8f0470b)
+++ sasview/setup_exe.py	(revision f36e01fa1b9b521d3f7496b637e33bed18626df2)
@@ -62,6 +62,6 @@
         sys.argv.remove('--extrapath')
 except:
-    print "Error processing extra python path needed to build SasView\n  %s" % \
-                sys.exc_value
+    print("Error processing extra python path needed to build SasView\n  %s" % \
+                sys.exc_value)
 
 
@@ -83,12 +83,11 @@
         modulefinder.AddPackagePath(win32_folder, p)
     for extra in ["win32com.shell", "win32com.adsi", "win32com.axcontrol",
-                    "win32com.axscript", "win32com.bits", "win32com.ifilter",
-                    "win32com.internet", "win32com.mapi", "win32com.propsys",
-                    "win32com.taskscheduler"]:
-        
-            __import__(extra)
-            m = sys.modules[extra]
-            for p in m.__path__[1:]:
-                modulefinder.AddPackagePath(extra, p)
+                  "win32com.axscript", "win32com.bits", "win32com.ifilter",
+                  "win32com.internet", "win32com.mapi", "win32com.propsys",
+                  "win32com.taskscheduler"]:
+        __import__(extra)
+        m = sys.modules[extra]
+        for p in m.__path__[1:]:
+            modulefinder.AddPackagePath(extra, p)
 
 except ImportError:
@@ -167,5 +166,5 @@
         self.copyright = "copyright 2009 - 2016"
         self.name = "SasView"
-        
+
 #
 # Adapted from http://www.py2exe.org/index.cgi/MatPlotLib
@@ -236,4 +235,8 @@
     data_files.append(('config', [f]))
 f = 'local_config.py'
+if os.path.isfile(f):
+    data_files.append(('.', [f]))
+
+f = 'logging.ini'
 if os.path.isfile(f):
     data_files.append(('.', [f]))
@@ -337,5 +340,5 @@
     ])
 packages.append('periodictable.core') # not found automatically
-#packages.append('IPython')
+# packages.append('IPython')
 includes = ['site', 'lxml._elementpath', 'lxml.etree']
 
@@ -370,5 +373,5 @@
     other_resources = [(24, 1, manifest)],
     dest_base = "SasView"
-    )
+)
 
 # bundle_option = 2
Index: sasview/setup_mac.py
===================================================================
--- sasview/setup_mac.py	(revision 235f514ba93b57fa63e44309f182acef0b98bb55)
+++ sasview/setup_mac.py	(revision cfa88eef20961bfc7dcff1169b6743d6c13b2451)
@@ -50,4 +50,6 @@
 #CANSAxml reader data files
 RESOURCES_FILES.append(os.path.join(sas.sascalc.dataloader.readers.get_data_path(),'defaults.json'))
+
+DATA_FILES.append('logging.ini')
 
 # Locate libxml2 library
Index: setup.py
===================================================================
--- setup.py	(revision 14bb7a4559442ca97cf523eddca7216d6be1e931)
+++ setup.py	(revision 14bb7a4559442ca97cf523eddca7216d6be1e931)
@@ -1,17 +1,23 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/env python
+
 """
     Setup for SasView
-    #TODO: Add checks to see that all the dependencies are on the system
+    TODO: Add checks to see that all the dependencies are on the system
 """
-import sys
+
 import os
 import subprocess
 import shutil
-from setuptools import setup, Extension
+import sys
 from distutils.command.build_ext import build_ext
 from distutils.core import Command
+
 import numpy as np
+from setuptools import Extension, setup
 
 # Manage version number ######################################
 import sasview
+
 VERSION = sasview.__version__
 ##############################################################
@@ -26,5 +32,5 @@
 # except when there is no such file
 # Todo : make this list generic
-#plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py',
+# plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py',
 #                      'sum_Ap1_1_Ap2.py', 'sum_p1_p2.py',
 #                      'testmodel_2.py', 'testmodel.py',
@@ -36,5 +42,5 @@
 SASVIEW_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build")
 
-sas_dir = os.path.join(os.path.expanduser("~"),'.sasview')
+sas_dir = os.path.join(os.path.expanduser("~"), '.sasview')
 if os.path.isdir(sas_dir):
     f_path = os.path.join(sas_dir, "sasview.log")
@@ -48,5 +54,5 @@
         os.remove(f_path)
     #f_path = os.path.join(sas_dir, 'plugin_models')
-    #if os.path.isdir(f_path):
+    # if os.path.isdir(f_path):
     #     for f in os.listdir(f_path):
     #         if f in plugin_model_list:
@@ -54,5 +60,6 @@
     #             os.remove(file_path)
     if os.path.exists(SASVIEW_BUILD):
-        print("Removing existing build directory", SASVIEW_BUILD, "for a clean build")
+        print("Removing existing build directory",
+              SASVIEW_BUILD, "for a clean build")
         shutil.rmtree(SASVIEW_BUILD)
 
@@ -64,5 +71,5 @@
 enable_openmp = False
 
-if sys.platform =='darwin':
+if sys.platform == 'darwin':
     if not is_64bits:
         # Disable OpenMP
@@ -78,23 +85,25 @@
 
 # Options to enable OpenMP
-copt =  {'msvc': ['/openmp'],
-         'mingw32' : ['-fopenmp'],
-         'unix' : ['-fopenmp']}
-lopt =  {'msvc': ['/MANIFEST'],
-         'mingw32' : ['-fopenmp'],
-         'unix' : ['-lgomp']}
+copt = {'msvc': ['/openmp'],
+        'mingw32': ['-fopenmp'],
+        'unix': ['-fopenmp']}
+lopt = {'msvc': ['/MANIFEST'],
+        'mingw32': ['-fopenmp'],
+        'unix': ['-lgomp']}
 
 # Platform-specific link options
-platform_lopt = {'msvc' : ['/MANIFEST']}
+platform_lopt = {'msvc': ['/MANIFEST']}
 platform_copt = {}
 
 # Set copts to get compile working on OS X >= 10.9 using clang
-if sys.platform =='darwin':
+if sys.platform == 'darwin':
     try:
         darwin_ver = int(os.uname()[2].split('.')[0])
         if darwin_ver >= 13 and darwin_ver < 14:
-            platform_copt = {'unix' : ['-Wno-error=unused-command-line-argument-hard-error-in-future']}
+            platform_copt = {
+                'unix': ['-Wno-error=unused-command-line-argument-hard-error-in-future']}
     except:
         print("PROBLEM determining Darwin version")
+
 
 class DisableOpenMPCommand(Command):
@@ -115,5 +124,6 @@
         pass
 
-class build_ext_subclass( build_ext ):
+
+class build_ext_subclass(build_ext):
     def build_extensions(self):
         # Get 64-bitness
@@ -125,20 +135,20 @@
             if c in copt:
                 for e in self.extensions:
-                    e.extra_compile_args = copt[ c ]
+                    e.extra_compile_args = copt[c]
             if c in lopt:
                 for e in self.extensions:
-                    e.extra_link_args = lopt[ c ]
+                    e.extra_link_args = lopt[c]
 
         # Platform-specific build options
         if c in platform_lopt:
             for e in self.extensions:
-                e.extra_link_args = platform_lopt[ c ]
+                e.extra_link_args = platform_lopt[c]
 
         if c in platform_copt:
             for e in self.extensions:
-                e.extra_compile_args = platform_copt[ c ]
-
+                e.extra_compile_args = platform_copt[c]
 
         build_ext.build_extensions(self)
+
 
 class BuildSphinxCommand(Command):
@@ -174,4 +184,5 @@
         build_sphinx.rebuild()
 
+
 # sas module
 package_dir["sas"] = os.path.join("src", "sas")
@@ -187,5 +198,6 @@
 
 # sas.sascalc.invariant
-package_dir["sas.sascalc.invariant"] = os.path.join("src", "sas", "sascalc", "invariant")
+package_dir["sas.sascalc.invariant"] = os.path.join(
+    "src", "sas", "sascalc", "invariant")
 packages.extend(["sas.sascalc.invariant"])
 
@@ -193,7 +205,9 @@
 guiframe_path = os.path.join("src", "sas", "sasgui", "guiframe")
 package_dir["sas.sasgui.guiframe"] = guiframe_path
-package_dir["sas.sasgui.guiframe.local_perspectives"] = os.path.join(os.path.join(guiframe_path, "local_perspectives"))
+package_dir["sas.sasgui.guiframe.local_perspectives"] = os.path.join(
+    os.path.join(guiframe_path, "local_perspectives"))
 package_data["sas.sasgui.guiframe"] = ['images/*', 'media/*']
-packages.extend(["sas.sasgui.guiframe", "sas.sasgui.guiframe.local_perspectives"])
+packages.extend(
+    ["sas.sasgui.guiframe", "sas.sasgui.guiframe.local_perspectives"])
 # build local plugin
 for d in os.listdir(os.path.join(guiframe_path, "local_perspectives")):
@@ -201,51 +215,62 @@
         package_name = "sas.sasgui.guiframe.local_perspectives." + d
         packages.append(package_name)
-        package_dir[package_name] = os.path.join(guiframe_path, "local_perspectives", d)
+        package_dir[package_name] = os.path.join(
+            guiframe_path, "local_perspectives", d)
 
 # sas.sascalc.dataloader
-package_dir["sas.sascalc.dataloader"] = os.path.join("src", "sas", "sascalc", "dataloader")
-package_data["sas.sascalc.dataloader.readers"] = ['defaults.json', 'schema/*.xsd']
-packages.extend(["sas.sascalc.dataloader", "sas.sascalc.dataloader.readers", "sas.sascalc.dataloader.readers.schema"])
+package_dir["sas.sascalc.dataloader"] = os.path.join(
+    "src", "sas", "sascalc", "dataloader")
+package_data["sas.sascalc.dataloader.readers"] = [
+    'defaults.json', 'schema/*.xsd']
+packages.extend(["sas.sascalc.dataloader", "sas.sascalc.dataloader.readers",
+                 "sas.sascalc.dataloader.readers.schema"])
+
 
 # sas.sascalc.calculator
 gen_dir = os.path.join("src", "sas", "sascalc", "calculator", "c_extensions")
 package_dir["sas.sascalc.calculator.core"] = gen_dir
-package_dir["sas.sascalc.calculator"] = os.path.join("src", "sas", "sascalc", "calculator")
-packages.extend(["sas.sascalc.calculator","sas.sascalc.calculator.core"])
-ext_modules.append( Extension("sas.sascalc.calculator.core.sld2i",
-        sources = [
-            os.path.join(gen_dir, "sld2i_module.cpp"),
-            os.path.join(gen_dir, "sld2i.cpp"),
-            os.path.join(gen_dir, "libfunc.c"),
-            os.path.join(gen_dir, "librefl.c"),
-        ],
-        include_dirs=[gen_dir],
-    )
-)
+package_dir["sas.sascalc.calculator"] = os.path.join(
+    "src", "sas", "sascalc", "calculator")
+packages.extend(["sas.sascalc.calculator", "sas.sascalc.calculator.core"])
+ext_modules.append(Extension("sas.sascalc.calculator.core.sld2i",
+                             sources=[
+                                 os.path.join(gen_dir, "sld2i_module.cpp"),
+                                 os.path.join(gen_dir, "sld2i.cpp"),
+                                 os.path.join(gen_dir, "libfunc.c"),
+                                 os.path.join(gen_dir, "librefl.c"),
+                             ],
+                             include_dirs=[gen_dir],
+                             )
+                   )
 
 # sas.sascalc.pr
-srcdir  = os.path.join("src", "sas", "sascalc", "pr", "c_extensions")
+srcdir = os.path.join("src", "sas", "sascalc", "pr", "c_extensions")
 package_dir["sas.sascalc.pr.core"] = srcdir
 package_dir["sas.sascalc.pr"] = os.path.join("src", "sas", "sascalc", "pr")
-packages.extend(["sas.sascalc.pr","sas.sascalc.pr.core"])
-ext_modules.append( Extension("sas.sascalc.pr.core.pr_inversion",
-                              sources = [os.path.join(srcdir, "Cinvertor.c"),
-                                         os.path.join(srcdir, "invertor.c"),
-                                         ],
-                              include_dirs=[],
-                              ) )
+packages.extend(["sas.sascalc.pr", "sas.sascalc.pr.core"])
+ext_modules.append(Extension("sas.sascalc.pr.core.pr_inversion",
+                             sources=[os.path.join(srcdir, "Cinvertor.c"),
+                                      os.path.join(srcdir, "invertor.c"),
+                                      ],
+                             include_dirs=[],
+                             ))
+
 
 # sas.sascalc.file_converter
 mydir = os.path.join("src", "sas", "sascalc", "file_converter", "c_ext")
 package_dir["sas.sascalc.file_converter.core"] = mydir
-package_dir["sas.sascalc.file_converter"] = os.path.join("src", "sas", "sascalc", "file_converter")
-packages.extend(["sas.sascalc.file_converter", "sas.sascalc.file_converter.core"])
-ext_modules.append( Extension("sas.sascalc.file_converter.core.bsl_loader",
-                              sources = [os.path.join(mydir, "bsl_loader.c")],
-                              include_dirs=[np.get_include()],
-                              ) )
-
-#sas.sascalc.corfunc
-package_dir["sas.sascalc.corfunc"] = os.path.join("src", "sas", "sascalc", "corfunc")
+package_dir["sas.sascalc.file_converter"] = os.path.join(
+    "src", "sas", "sascalc", "file_converter")
+packages.extend(["sas.sascalc.file_converter",
+                 "sas.sascalc.file_converter.core"])
+ext_modules.append(Extension("sas.sascalc.file_converter.core.bsl_loader",
+                             sources=[os.path.join(mydir, "bsl_loader.c")],
+                             include_dirs=[np.get_include()],
+                             ))
+
+# sas.sascalc.corfunc
+package_dir["sas.sascalc.corfunc"] = os.path.join(
+    "src", "sas", "sascalc", "corfunc")
+
 packages.extend(["sas.sascalc.corfunc"])
 
@@ -255,35 +280,48 @@
 
 # Perspectives
-package_dir["sas.sasgui.perspectives"] = os.path.join("src", "sas", "sasgui", "perspectives")
-package_dir["sas.sasgui.perspectives.pr"] = os.path.join("src", "sas", "sasgui", "perspectives", "pr")
-packages.extend(["sas.sasgui.perspectives","sas.sasgui.perspectives.pr"])
+package_dir["sas.sasgui.perspectives"] = os.path.join(
+    "src", "sas", "sasgui", "perspectives")
+package_dir["sas.sasgui.perspectives.pr"] = os.path.join(
+    "src", "sas", "sasgui", "perspectives", "pr")
+packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.pr"])
 package_data["sas.sasgui.perspectives.pr"] = ['media/*']
 
-package_dir["sas.sasgui.perspectives.invariant"] = os.path.join("src", "sas", "sasgui", "perspectives", "invariant")
+package_dir["sas.sasgui.perspectives.invariant"] = os.path.join(
+    "src", "sas", "sasgui", "perspectives", "invariant")
 packages.extend(["sas.sasgui.perspectives.invariant"])
-package_data['sas.sasgui.perspectives.invariant'] = [os.path.join("media",'*')]
-
-package_dir["sas.sasgui.perspectives.fitting"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting")
-package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join("src", "sas", "sasgui", "perspectives", "fitting", "plugin_models")
-packages.extend(["sas.sasgui.perspectives.fitting", "sas.sasgui.perspectives.fitting.plugin_models"])
-package_data['sas.sasgui.perspectives.fitting'] = ['media/*', 'plugin_models/*']
-
-packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.calculator"])
+package_data['sas.sasgui.perspectives.invariant'] = [
+    os.path.join("media", '*')]
+
+package_dir["sas.sasgui.perspectives.fitting"] = os.path.join(
+    "src", "sas", "sasgui", "perspectives", "fitting")
+package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join(
+    "src", "sas", "sasgui", "perspectives", "fitting", "plugin_models")
+packages.extend(["sas.sasgui.perspectives.fitting",
+                 "sas.sasgui.perspectives.fitting.plugin_models"])
+package_data['sas.sasgui.perspectives.fitting'] = [
+    'media/*', 'plugin_models/*']
+
+packages.extend(["sas.sasgui.perspectives",
+                 "sas.sasgui.perspectives.calculator"])
 package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*']
 
-package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join("src", "sas", "sasgui", "perspectives", "corfunc")
+package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join(
+    "src", "sas", "sasgui", "perspectives", "corfunc")
 packages.extend(["sas.sasgui.perspectives.corfunc"])
 package_data['sas.sasgui.perspectives.corfunc'] = ['media/*']
 
-package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join("src", "sas", "sasgui", "perspectives", "file_converter")
+package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join(
+    "src", "sas", "sasgui", "perspectives", "file_converter")
 packages.extend(["sas.sasgui.perspectives.file_converter"])
 package_data['sas.sasgui.perspectives.file_converter'] = ['media/*']
 
 # Data util
-package_dir["sas.sascalc.data_util"] = os.path.join("src", "sas", "sascalc", "data_util")
+package_dir["sas.sascalc.data_util"] = os.path.join(
+    "src", "sas", "sascalc", "data_util")
 packages.append("sas.sascalc.data_util")
 
 # Plottools
-package_dir["sas.sasgui.plottools"] = os.path.join("src", "sas", "sasgui", "plottools")
+package_dir["sas.sasgui.plottools"] = os.path.join(
+    "src", "sas", "sasgui", "plottools")
 packages.append("sas.sasgui.plottools")
 
@@ -293,4 +331,5 @@
 
 EXTENSIONS = [".c", ".cpp"]
+
 
 def append_file(file_list, dir_path):
@@ -312,10 +351,11 @@
                         file_list.append(os.path.join(sub_dir, new_f))
 
+
 # Comment out the following to avoid rebuilding all the models
 file_sources = []
 append_file(file_sources, gen_dir)
 
-#Wojtek's hacky way to add doc files while bundling egg
-#def add_doc_files(directory):
+# Wojtek's hacky way to add doc files while bundling egg
+# def add_doc_files(directory):
 #    paths = []
 #    for (path, directories, filenames) in os.walk(directory):
@@ -330,4 +370,5 @@
 package_data['sas.sasview'] = ['images/*',
                                'media/*',
+                               'logging.ini',
                                'test/*.txt',
                                'test/1d_data/*',
@@ -349,11 +390,11 @@
     'lxml', 'h5py',
 
-    ## The following dependecies won't install automatically, so assume them
-    ## The numbers should be bumped up for matplotlib and wxPython as well.
+    # The following dependecies won't install automatically, so assume them
+    # The numbers should be bumped up for matplotlib and wxPython as well.
     # 'numpy>=1.4.1', 'scipy>=0.7.2', 'matplotlib>=0.99.1.1',
     # 'wxPython>=2.8.11', 'pil',
-    ]
-
-if os.name=='nt':
+]
+
+if os.name == 'nt':
     required.extend(['html5lib', 'reportlab'])
 else:
@@ -364,25 +405,25 @@
 setup(
     name="sasview",
-    version = VERSION,
-    description = "SasView application",
-    author = "SasView Team",
-    author_email = "developers@sasview.org",
-    url = "http://sasview.org",
-    license = "PSF",
-    keywords = "small-angle x-ray and neutron scattering analysis",
-    download_url = "https://github.com/SasView/sasview.git",
-    package_dir = package_dir,
-    packages = packages,
-    package_data = package_data,
-    ext_modules = ext_modules,
-    install_requires = required,
-    zip_safe = False,
-    entry_points = {
-                    'console_scripts':[
-                                       "sasview = sas.sasview.sasview:run",
-                                       ]
-                    },
-    cmdclass = {'build_ext': build_ext_subclass,
-                'docs': BuildSphinxCommand,
-                'disable_openmp': DisableOpenMPCommand}
-    )
+    version=VERSION,
+    description="SasView application",
+    author="SasView Team",
+    author_email="developers@sasview.org",
+    url="http://sasview.org",
+    license="PSF",
+    keywords="small-angle x-ray and neutron scattering analysis",
+    download_url="https://github.com/SasView/sasview.git",
+    package_dir=package_dir,
+    packages=packages,
+    package_data=package_data,
+    ext_modules=ext_modules,
+    install_requires=required,
+    zip_safe=False,
+    entry_points={
+        'console_scripts': [
+            "sasview = sas.sasview.sasview:run",
+        ]
+    },
+    cmdclass={'build_ext': build_ext_subclass,
+              'docs': BuildSphinxCommand,
+              'disable_openmp': DisableOpenMPCommand}
+)
Index: src/sas/sasgui/guiframe/gui_manager.py
===================================================================
--- src/sas/sasgui/guiframe/gui_manager.py	(revision 49165488dcf1dbf657666bc78e3d4b4904d1c094)
+++ src/sas/sasgui/guiframe/gui_manager.py	(revision 38beeabb5ee27ed084d34cff146a43b594e5192f)
@@ -77,9 +77,9 @@
     # clean all these module variables and put them into a config class
     # that can be passed by sasview.py.
-    logger.info(sys.executable)
-    logger.info(str(sys.argv))
+    logger.debug(sys.executable)
+    logger.debug(str(sys.argv))
     from sas import sasview as sasview
     app_path = os.path.dirname(sasview.__file__)
-    logger.info("Using application path: %s", app_path)
+    logger.debug("Using application path: %s", app_path)
     return app_path
 
@@ -109,5 +109,5 @@
         if fObj is not None:
             fObj.close()
-    logger.info("GuiManager loaded %s/%s" % (path, file))
+    logger.debug("GuiManager loaded %s/%s" % (path, file))
     return config_module
 
@@ -126,9 +126,9 @@
         # Didn't find local config, load the default
         import sas.sasgui.guiframe.config as config
-        logger.info("using default local_config")
+        logger.debug("using default local_config")
     else:
-        logger.info("found local_config in %s" % os.getcwd())
+        logger.debug("found local_config in %s" % os.getcwd())
 else:
-    logger.info("found local_config in %s" % PATH_APP)
+    logger.debug("found local_config in %s" % PATH_APP)
 
 from sas.sasgui.guiframe.customdir import SetupCustom
@@ -139,9 +139,9 @@
     if custom_config is None:
         msgConfig = "Custom_config file was not imported"
-        logger.info(msgConfig)
+        logger.debug(msgConfig)
     else:
-        logger.info("using custom_config in %s" % os.getcwd())
+        logger.debug("using custom_config in %s" % os.getcwd())
 else:
-    logger.info("using custom_config from %s" % c_conf_dir)
+    logger.debug("using custom_config from %s" % c_conf_dir)
 
 # read some constants from config
@@ -2156,8 +2156,6 @@
         if response is not None:
             try:
-                # 
                 content = response.read().strip()
-                logger.info("Connected to www.sasview.org. Latest version: %s"
-                             % (content))
+                logger.info("Connected to www.sasview.org. Latest version: %s", content)
                 version_info = json.loads(content)
             except:
