import RTCStats from './RTCStats';
/**
* The default log storage implementation.
*/
export default class DefaultLogStorage {
private rtcStats: any;
/**
* Creates new instance of DefaultLogStorage.
* @param rtcStats - The RTCStats instance.
*/
constructor(rtcStats: any) {
this.rtcStats = rtcStats;
}
/**
* The DefaultLogStorage is ready when the RTCStats is ready.
*
* @returns {boolean} true when this storage is ready or
* false otherwise.
*/
isReady() {
return this.rtcStats._initialized;
}
/**
* Called by the LogCollector to store a series of log lines into
* batch.
*
* @param {Array} logEntries - An array containing strings
* representing log lines or aggregated lines objects.
* @returns {void}
*/
storeLogs(logEntries: Array) {
RTCStats.sendStatsEntry('logs', null, logEntries);
}
}