Commit 917d0440 authored by Jerome Touvier's avatar Jerome Touvier Committed by Jerome Touvier
Browse files

remove config file

parent 490e96bb
**/logs
**/__pycache__
stationxml-seed-converter-2.1.0.jar
# List of loggers, handlers and formatters:
[loggers]
keys=root
[handlers]
#keys=consoleHandler, fileHandler
keys=consoleHandler
[formatters]
keys=generic, verbose
# loggers:
[logger_root]
level=DEBUG
#handlers=consoleHandler, fileHandler
handlers=consoleHandler
# handlers:
[handler_consoleHandler]
class=StreamHandler
level=DEBUG
formatter=generic
args=(sys.stdout,)
# formatters:
[formatter_generic]
#format=[%(asctime)s] %(levelname)s (%(process)d) [%(module)s:%(lineno)d] %(message)s
format=[%(asctime)s] %(levelname)s (%(process)d) [%(pathname)s:%(lineno)d] %(message)s
# datefmt='%Y-%m-%d %H:%M:%
[formatter_verbose]
format=[%(asctime)s] %(levelname)s (%(process)d) [%(pathname)s:%(lineno)d] %(message)s %(stack_info)s
import logging.config
import os
def set_env():
try:
logging.getLogger("matplotlib").setLevel(logging.WARNING)
except Exception:
pass
# get RUNMODE environment variable
try:
RUNMODE = os.environ["RUNMODE"]
except Exception:
print("RUNMODE IS NOT DEFINED !")
return False
try:
# set logging config
CONFIG_FILE = "logging_config_dev.ini"
FILE_DIR = os.path.dirname(__file__)
logging.config.fileConfig(os.path.join(FILE_DIR, "apps", CONFIG_FILE))
logging.debug("RUNMODE = %s" % RUNMODE)
return True
except Exception as ex:
print(str(ex))
return False
from flask import Flask, make_response, render_template, redirect, request
from config import set_env
if not set_env():
exit(1)
from apps.constants import VERSION
from apps.root import output
......
from flask import Flask, make_response, render_template, redirect, request
from config import set_env
if not set_env():
exit(1)
from apps.constants import VERSION
from apps.root import output
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment