Skip to content

Commit

Permalink
do not call '+' in logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ssato committed Feb 20, 2015
1 parent dea3eef commit 4a1b580
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions anyconfig/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,15 @@ def find_loader(config_path, forced_type=None):
if forced_type is not None:
cparser = Backends.find_by_type(forced_type)
if not cparser:
logging.error(
"No parser found for given type: " + forced_type
)
logging.error("No parser found for given type: %s", forced_type)
return None
else:
cparser = Backends.find_by_file(config_path)
if not cparser:
logging.error(
"No parser found for given file: " + config_path
)
logging.error("No parser found for given file: %s", config_path)
return None

logging.debug("Using config parser of type: " + cparser.type())
logging.debug("Using config parser of type: %s", cparser.type())
return cparser


Expand All @@ -82,7 +78,7 @@ def single_load(config_path, forced_type=None, ignore_missing=False, **kwargs):
if cparser is None:
return None

logging.info("Loading: " + config_path)
logging.info("Loading: %s", config_path)
return cparser.load(config_path, ignore_missing=ignore_missing, **kwargs)


Expand Down Expand Up @@ -187,9 +183,8 @@ def _find_dumper(config_path, forced_type=None):
cparser = find_loader(config_path, forced_type)

if cparser is None or not getattr(cparser, "dump", False):
logging.warn(
"Dump method not implemented. Fallback to JsonConfigParser"
)
logging.warn("Dump method not implemented. Fallback to "
"JsonConfigParser")
cparser = BJ.JsonConfigParser()

return cparser
Expand All @@ -208,7 +203,7 @@ def dump(data, config_path, forced_type=None, **kwargs):
"""
dumper = _find_dumper(config_path, forced_type)

logging.info("Dumping: " + config_path)
logging.info("Dumping: %s", config_path)
dumper.dump(data, config_path, **kwargs)


Expand Down
2 changes: 1 addition & 1 deletion anyconfig/backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def mk_dump_dir_if_not_exist(f):
dumpdir = os.path.dirname(f)

if not os.path.exists(dumpdir):
logging.debug("Creating output dir as it's not found: " + dumpdir)
logging.debug("Creating output dir as it's not found: %s", dumpdir)
os.makedirs(dumpdir)


Expand Down

0 comments on commit 4a1b580

Please sign in to comment.