-
Notifications
You must be signed in to change notification settings - Fork 937
Client logging API: methods for users to access the SDK's log messages #2434
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it's pretty good. A couple of things:
-
The implementation is different than the proposal where the instance of the service is passed to the user defined callback as a parameter. We should update the proposal with the reasons for the new API and get the approval again.
-
Performance has a special logger to upload performance metrics to the backend.
Any action on it should not trigger the user definedonLog
callback. We will need to introduce a flag or something to tell the special loggers apart and they should not participate inonLog
.
https://github.com/firebase/firebase-js-sdk/blob/master/packages/performance/src/services/perf_logger.ts#L95
I actually think it's a misuse for perf to use @firebase/logger
for the purpose of uploading metrics. So another approach can change perf to not use @firebase/logger
for uploading metrics.
I am making a PR for the perf logger conflict issue: #2460. |
ed4f58c
to
2e65846
Compare
Adds
firebase.setLogLevel()
- set threshhold log level to showfirebase.onLog()
- add a user specified callback that has access to log level, message, and name of package (e.g. app, firestore, auth) that logged it