Browse Source

Construct path to logging conf using __file__ variable

pull/59/head
Wesley Kerfoot 5 years ago
parent
commit
73e98905c0
  1. 6
      deletefb/tools/common.py

6
deletefb/tools/common.py

@ -40,7 +40,11 @@ def logger(name):
Returns:
logging.Logger
"""
config_path = "../logging_conf.json"
# Make sure the path always points to the correct directory
config_path = os.path.dirname(
os.path.realpath(__file__)) + "/../logging_conf.json"
if not isfile(config_path): # called from file (deletefb.py)
os.chdir("..")
with open(config_path, "r", encoding="utf-8") as config_file:

Loading…
Cancel
Save