Skip to content

Commit

Permalink
Merge pull request #94 from computas/release/master
Browse files Browse the repository at this point in the history
Release/master
  • Loading branch information
ellenyuX authored Sep 10, 2024
2 parents adfc91f + c1ac5b0 commit 01f21bc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-production-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT

steps:
- name: Download artifact from build job
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ config.json
src/config.json
.idea
.venv
src/record.log
15 changes: 13 additions & 2 deletions src/webapp/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from PIL import ImageChops
from io import BytesIO
from datetime import datetime
import logging
from logging.handlers import RotatingFileHandler
import os
import json
import uuid
Expand All @@ -30,9 +32,18 @@
# Initialize app
app = Flask(__name__)
logger = True
app.logger.setLevel("INFO")

#config logging
logging.basicConfig(filename='record.log', level=logging.INFO, filemode="w", format="%(asctime)s %(levelname)s %(message)s")
#max file size 4 MB
handler = RotatingFileHandler(
filename='record.log',
maxBytes=4 * 1024 * 1024,
backupCount=5
)
app.logger.addHandler(handler)

if "IS_PRODUCTION" in os.environ:
app.logger.setLevel("WARNING")
logger = True
if Keys.exists("CORS_ALLOWED_ORIGIN"):
app.logger.info("cors is: " + Keys.get("CORS_ALLOWED_ORIGIN"))
Expand Down

0 comments on commit 01f21bc

Please sign in to comment.