Updated to use abspath of the file not the call location.

This commit is contained in:
2018-05-06 18:09:13 +02:00
parent 71e9a5a46e
commit b99b5b32ec

View File

@@ -92,7 +92,9 @@ def moveStray(strayId):
logging.warning('Cannot remove ' + ep.typeDir('parent_input') + ', file no longer exists.')
if __name__ == '__main__':
if (os.path.exists(env.logfile)):
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
if (os.path.exists(os.path.join(dname, env.logfile))):
logging.basicConfig(filename=env.logfile, level=logging.INFO)
else:
print('Logfile could not be found at ' + env.logfile + '. Verifiy presence or disable logging in config.')