get-convex / convex-auth

Library for built-in auth
https://labs.convex.dev/auth
51 stars 15 forks source link

Add more debug logging to Convex Auth #64

Closed sshader closed 1 month ago

sshader commented 1 month ago

I want the option of seeing more logs when debugging so we can have a clearer idea of what's going on.

I added a logWithLevel helper that uses AUTH_LOG_LEVEL to conditionally log things, and converted all existing console.log / console.error to use that.

I then added a bunch of debug logging (off by default) anywhere that seemed useful. I want to be careful to not log anything too sensitive, so I also made a maybeRedact helper (granted, almost anything we'd log here is also stored in the database). Given that all the new logging is off by default, I'm not too worried about something slipping by.

I also went ahead and switched tests to use AUTH_LOG_LEVEL="ERROR" so they don't log spam too much.

vercel[bot] commented 1 month ago

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

Name Status Preview Comments Updated (UTC)
convex-auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 4, 2024 8:40pm