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

Debugger enhancements #5288

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Debugger enhancements #5288

wants to merge 3 commits into from

Conversation

gilluminate
Copy link
Contributor

Description Of Changes

The way our current debugger is working, we lose the originating file and line number from the original call. By bumping the called function into the global scope, it behaves like a normal log but with the added benefit of only working in debug mode. These changes support both the browser and nodejs environments by adding global as a child of window, mimicking the global of node. This is how other frameworks have accomplished this (eg. Angular) and is not an uncommon practice.

Code Changes

  • Add fidesLogger to the global scope as a conditional
  • Add global as a child of window
  • Replace instances of debugLog with global.fidesLogger (named to avoid conflicts)
  • Remove debugLog

Steps to Confirm

  • Visit the demo page in debug mode. Note the logs in the browser console now show the filename/line of where the log was called, rather than the utility file line where the debugLog was set.

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md

Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Sep 16, 2024 4:00pm

@gilluminate gilluminate changed the title Gill/debugger enhancements Debugger enhancements Sep 16, 2024
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.

1 participant