Skip to content
Snippets Groups Projects
Commit 1ab927eb authored by jlaura's avatar jlaura Committed by Jason R Laura
Browse files

Logging needs to default to an example that we already have.

parent 15ffe81e
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,10 @@ import os
import json
import logging.config
def setup_logging(default_path='logging.json',
from ..examples import get_path
def setup_logging(default_path=get_path('logging.json'),
default_level='INFO',
env_key='LOG_CFG'):
"""
......@@ -28,7 +31,8 @@ def setup_logging(default_path='logging.json',
logtype = os.path.splitext(os.path.basename(path))[1]
with open(path, 'rt') as f:
if logtype == '.json':
config = json.load(f)
config = json.load(f, parse_float=True,
parse_int=True)
elif logtype == '.yaml':
import yaml
config = yaml.load(f.read())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment