Skip to content

Commit

Permalink
Merge pull request #73 from ral-facilities/71_change_file_paths
Browse files Browse the repository at this point in the history
Use pathlib for config and logger
  • Loading branch information
keiranjprice101 authored Sep 23, 2019
2 parents ac62218 + c2eb214 commit e2cf13d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion common/config.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import json
import sys
from pathlib import Path


class Config(object):

def __init__(self):
with open("../config.json") as target:
with open(Path("config.json")) as target:
self.config = json.load(target)
target.close()

Expand Down
6 changes: 4 additions & 2 deletions common/logger_setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import logging.config
from common.config import config
from pathlib import Path

from common.config import config

log_level = "DEBUG"
LOG_FILE_NAME = "../logs.log"
LOG_FILE_NAME = Path("logs.log")
logger_config = {
"version": 1,
"formatters": {"default": {
Expand Down

0 comments on commit e2cf13d

Please sign in to comment.