Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

make config-loading debug messages more explicit #703

Merged
merged 1 commit into from

2 participants

Min RK Fernando Perez
Min RK
Owner

It was never clear in debug messages that the cwd is searched
for config files. This adjusts various debug messages during
config-file loading to make things more clear.

The following debug messages were added:

  • specify search-path at start of load-config routine
  • on success, full path of loaded config files
  • always note when config files are not found
Min RK minrk make config-loading debug messages more explicit
It was never clear in debug messages that the cwd is searched
for config files.  This adjusts various debug messages during
config-file loading to make things more clear:

The following debug messages were added:
* specify search-path at start of load-config routine
* on success, full path of loaded config files
* always note when config files are not found
b9a348b
Fernando Perez
Owner
Fernando Perez
Owner
Min RK
Owner
Fernando Perez
Owner

Great, then merge away!

Fernando Perez fperez merged commit fbc50c4 into from
Fernando Perez fperez referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 15, 2011
  1. Min RK

    make config-loading debug messages more explicit

    minrk authored
    It was never clear in debug messages that the cwd is searched
    for config files.  This adjusts various debug messages during
    config-file loading to make things more clear:
    
    The following debug messages were added:
    * specify search-path at start of load-config routine
    * on success, full path of loaded config files
    * always note when config files are not found
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 4 deletions.
  1. +6 −2 IPython/config/application.py
  2. +6 −2 IPython/core/application.py
8 IPython/config/application.py
View
@@ -373,10 +373,14 @@ def load_config_file(self, filename, path=None):
# problem with the file (probably doesn't exist), raise
raise
except Exception:
+ # try to get the full filename, but it will be empty in the
+ # unlikely event that the error raised before filefind finished
+ filename = loader.full_filename or filename
# problem while running the file
- self.log.error("Exception while loading config file %s [path=%s]"%
- (filename, path), exc_info=True)
+ self.log.error("Exception while loading config file %s",
+ filename, exc_info=True)
else:
+ self.log.debug("Loaded config file: %s", loader.full_filename)
self.update_config(config)
def generate_config_file(self):
8 IPython/core/application.py
View
@@ -172,6 +172,7 @@ def load_config_file(self, suppress_errors=True):
printed on screen. For testing, the suppress_errors option is set
to False, so errors will make tests fail.
"""
+ self.log.debug("Searching path %s for config files", self.config_file_paths)
base_config = 'ipython_config.py'
self.log.debug("Attempting to load config file: %s" %
base_config)
@@ -183,6 +184,7 @@ def load_config_file(self, suppress_errors=True):
)
except IOError:
# ignore errors loading parent
+ self.log.debug("Config file %s not found", base_config)
pass
if self.config_file_name == base_config:
# don't load secondary config
@@ -198,8 +200,10 @@ def load_config_file(self, suppress_errors=True):
except IOError:
# Only warn if the default config file was NOT being used.
if self.config_file_specified:
- self.log.warn("Config file not found, skipping: %s" %
- self.config_file_name)
+ msg = self.log.warn
+ else:
+ msg = self.log.debug
+ msg("Config file not found, skipping: %s", self.config_file_name)
except:
# For testing purposes.
if not suppress_errors:
Something went wrong with that request. Please try again.