Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

DefaulLogStorage.ts 1004B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import RTCStats from './RTCStats';
  2. /**
  3. * The default log storage implementation.
  4. */
  5. export default class DefaultLogStorage {
  6. private rtcStats: any;
  7. /**
  8. * Creates new instance of <tt>DefaultLogStorage</tt>.
  9. * @param rtcStats - The RTCStats instance.
  10. */
  11. constructor(rtcStats: any) {
  12. this.rtcStats = rtcStats;
  13. }
  14. /**
  15. * The DefaultLogStorage is ready when the RTCStats is ready.
  16. *
  17. * @returns {boolean} <tt>true</tt> when this storage is ready or
  18. * <tt>false</tt> otherwise.
  19. */
  20. isReady() {
  21. return this.rtcStats._initialized;
  22. }
  23. /**
  24. * Called by the <tt>LogCollector</tt> to store a series of log lines into
  25. * batch.
  26. *
  27. * @param {Array<string|Object>} logEntries - An array containing strings
  28. * representing log lines or aggregated lines objects.
  29. * @returns {void}
  30. */
  31. storeLogs(logEntries: Array<string | any>) {
  32. RTCStats.sendStatsEntry('logs', null, logEntries);
  33. }
  34. }