Replace console.logs to logger.log
Related https://github.com/vector-im/element-web/issues/18425
This commit is contained in:
parent
12632318ef
commit
9c594a8a96
4 changed files with 21 additions and 13 deletions
|
@ -23,6 +23,8 @@ import { ExportType } from "./exportUtils";
|
|||
import { IExportOptions } from "./exportUtils";
|
||||
import { EventType } from "matrix-js-sdk/src/@types/event";
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
export default class JSONExporter extends Exporter {
|
||||
protected totalSize = 0;
|
||||
protected messages: Record<string, any>[] = [];
|
||||
|
@ -67,7 +69,7 @@ export default class JSONExporter extends Exporter {
|
|||
this.addFile(filePath, blob);
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Error fetching file: " + err);
|
||||
logger.log("Error fetching file: " + err);
|
||||
}
|
||||
}
|
||||
const jsonEvent: any = mxEv.toJSON();
|
||||
|
@ -94,7 +96,7 @@ export default class JSONExporter extends Exporter {
|
|||
const res = await this.getRequiredEvents();
|
||||
const fetchEnd = performance.now();
|
||||
|
||||
console.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
|
||||
logger.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
|
||||
|
||||
console.info("Creating output...");
|
||||
const text = await this.createOutput(res);
|
||||
|
@ -113,7 +115,7 @@ export default class JSONExporter extends Exporter {
|
|||
console.info("Export cancelled successfully");
|
||||
} else {
|
||||
console.info("Export successful!");
|
||||
console.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
||||
logger.log(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
||||
}
|
||||
|
||||
this.cleanUp();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue