Sanitize DEBUG ENV
This commit is contained in:
parent
e70414abc7
commit
d357351651
1 changed files with 6 additions and 2 deletions
|
@ -55,8 +55,12 @@ if __name__ == "__main__":
|
||||||
else:
|
else:
|
||||||
exit("{} does not exist".format(ARG_FOLDER))
|
exit("{} does not exist".format(ARG_FOLDER))
|
||||||
|
|
||||||
if os.getenv('DEBUG', False) == 'True':
|
# Set Debug to True if DEBUG env is set
|
||||||
opts.debug = True
|
enable_opts = ['True', 'true', 'yes']
|
||||||
|
debug_opts = ['debug', 'Debug', 'DEBUG']
|
||||||
|
|
||||||
|
opts.debug = True if any([os.getenv(string, False) for true in enable_opts
|
||||||
|
for string in debug_opts if os.getenv(string, False) == true]) else False
|
||||||
|
|
||||||
# Initiate the logger
|
# Initiate the logger
|
||||||
vl = VarkenLogger(data_folder=DATA_FOLDER, debug=opts.debug)
|
vl = VarkenLogger(data_folder=DATA_FOLDER, debug=opts.debug)
|
||||||
|
|
Loading…
Reference in a new issue