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.
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 usesAUTH_LOG_LEVEL
to conditionally log things, and converted all existingconsole.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.