Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
32f94ccf
Commit
32f94ccf
authored
2 years ago
by
Jeremy M Fee
Browse files
Options
Downloads
Patches
Plain Diff
api: logging environment variable for webservice
parent
d7b517ae
No related branches found
No related tags found
1 merge request
!193
Api hotfix sqlalchemy
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
geomagio/api/app.py
+8
-2
8 additions, 2 deletions
geomagio/api/app.py
with
8 additions
and
2 deletions
geomagio/api/app.py
+
8
−
2
View file @
32f94ccf
...
@@ -6,13 +6,19 @@ and can be run using uvicorn, or any other ASGI server:
...
@@ -6,13 +6,19 @@ and can be run using uvicorn, or any other ASGI server:
uvicorn geomagio.api:app
uvicorn geomagio.api:app
"""
"""
import
logging
import
os
from
fastapi
import
FastAPI
from
fastapi
import
FastAPI
from
starlette.responses
import
RedirectResponse
from
starlette.responses
import
RedirectResponse
from
.
import
secure
,
ws
from
.db
import
database
from
.db
import
database
from
.
import
secure
from
.
import
ws
# configure logging
DEBUG
=
os
.
getenv
(
'
DEBUG
'
,
'
false
'
)
LOG_LEVEL
=
logging
.
DEBUG
if
DEBUG
==
"
true
"
else
logging
.
INFO
logging
.
basicConfig
(
level
=
LOG_LEVEL
)
app
=
FastAPI
()
app
=
FastAPI
()
app
.
mount
(
"
/ws/secure
"
,
secure
.
app
)
app
.
mount
(
"
/ws/secure
"
,
secure
.
app
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment