Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API logger work #603

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

API logger work #603

wants to merge 16 commits into from

Conversation

Sigfried
Copy link
Collaborator

@Sigfried Sigfried commented Nov 2, 2023

Some refactoring here. Oh, and forgot to mention in the commit msg that schema override is still in middleware that always runs, but by itself now. It allows us to put schema=foo in the query string of any api call and expect to get the schema we want.

Sigfried and others added 14 commits October 30, 2023 11:19
  what calls are comming in
- Moved load_dotenv(ENVFILE) out of db/config and
  enclave_wrangler/config into backend.config. If you import that, it
  will get loaded
- Working on make_new_versions_of_csets for N3C Recommended updates
  it runs or fails, it should update the log with success/error message
  and how long it took
appeared there after i did the pip freeze
- Changed it from middleware to a regular function that needs to
  be called by any route handlers that want to use it. It adds seven
  lines to those functions, but the logger code is much easier to deal
  with now.
- Added that code to every almost route called by the front on the
  search and comparison pages.
- It finally logs useful information when errors occur
- Had to make return_err_with_trace async
- Moved redundant config stuff to backend/config
@Sigfried Sigfried temporarily deployed to Backend: Development November 2, 2023 23:59 — with GitHub Actions Inactive
@Sigfried Sigfried temporarily deployed to Backend: Development November 3, 2023 02:01 — with GitHub Actions Inactive
@@ -243,12 +175,14 @@ def set_nested_in_dict(d: Dict, key_path: List, value: Any):

def return_err_with_trace(func):
"""Handle exceptions"""
# @joeflack4: is this helping us? it's used for four routes. it took me a while to track down
# that it needed to be async and have `await func(..)`
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind. it is useful:
image

But we need to fix the front end to take advantage of it.

- updated fastapi (which chatgpt recommended while debugging)
@Sigfried Sigfried temporarily deployed to Backend: Development November 3, 2023 12:57 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants