GSI - Employe Self Service Mobile
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

2 months ago
  1. # @firebase/logger
  2. This package serves as the base of all logging in the JS SDK. Any logging that
  3. is intended to be visible to Firebase end developers should go through this
  4. module.
  5. ## Basic Usage
  6. Firebase components should import the `Logger` class and instantiate a new
  7. instance by passing a component name (e.g. `@firebase/<COMPONENT>`) to the
  8. constructor.
  9. _e.g._
  10. ```typescript
  11. import { Logger } from '@firebase/logger';
  12. const logClient = new Logger(`@firebase/<COMPONENT>`);
  13. ```
  14. Each `Logger` instance supports 5 log functions each to be used in a specific
  15. instance:
  16. - `debug`: Internal logs; use this to allow developers to send us their debug
  17. logs for us to be able to diagnose an issue.
  18. - `log`: Use to inform your user about things they may need to know.
  19. - `info`: Use if you have to inform the user about something that they need to
  20. take a concrete action on. Once they take that action, the log should go away.
  21. - `warn`: Use when a product feature may stop functioning correctly; unexpected
  22. scenario.
  23. - `error`: Only use when user App would stop functioning correctly - super rare!
  24. ## Log Format
  25. Each log will be formatted in the following manner:
  26. ```typescript
  27. `[${new Date()}] ${COMPONENT_NAME}: ${...args}`
  28. ```