Skip to content

Commit

Permalink
add log config
Browse files Browse the repository at this point in the history
  • Loading branch information
chandra-tacc committed Oct 30, 2023
1 parent 875eaa0 commit b291cf9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import pandas as pd
import csv
import logging
from logging.config import dictConfig

# from data_processing import *
from data_loading import *


# ----------------------------------------------------------------------------
# DATA PARAMETERS
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -117,9 +119,25 @@
'raw': None
}

dictConfig({
'version': 1,
'formatters': {'default': {
'format': '[%(asctime)s] %(levelname)s in %(module)s: %(message)s',
}},
'handlers': {'wsgi': {
'class': 'logging.StreamHandler',
'formatter': 'default'
}},
'root': {
'level': 'DEBUG',
'handlers': ['wsgi']
}
})

app = Flask(__name__)
app.debug = True
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('werkzeug').setLevel(logging.INFO)

# APIS: try to load new data, if doesn't work, get most recent
@app.route("/api/apis")
Expand Down

0 comments on commit b291cf9

Please sign in to comment.