Conversation
|
I need to update this for when the debug logger piece is officially reviewed and released, and there's a system test thing to look at, but the code itself is largely ready, I think. |
src/auth/baseexternalclient.ts
Outdated
| import {log as makeLog} from 'google-logging-utils'; | ||
| const log = makeLog('auth'); |
There was a problem hiding this comment.
I think it may be cleaner and flexible to add this to the base AuthClient class and have it as a member or static method.
This will allow:
- Customers to change/modify the log functionality (if they want)
- Dedupe the import statements across the files
Additionally, in the next major we're planning to unify the Transporter instance into AuthClient via this PR:
It would be an even smaller migration after that has landed as we could extend the GaxiosOptions interface with a Symbol (which would note the type of log) and use log.info on every request (as all requests would use that _request method).
There was a problem hiding this comment.
Thanks for the quick review. I'll make that change tomorrow.
There was a problem hiding this comment.
A lot of the logging can be done through AuthClient now, good call. There are a few objects that don't seem to derive ultimately from AuthClient, so I moved makeLog() into the class itself to make it cleaner. (makeLog caches the loggers by name, so there's little harm in calling it multiple times.)
|
Is this version of the PR safe to close? |
|
Yep, sorry, I seem to have forgotten to close it. |
Adds debug logging support for auth. This needs a bit more work/testing still.
It's also waiting on this to finish:
googleapis/gax-nodejs#1669