update logger and LJM to support log timestamps

This commit is contained in:
paweldomas
2019-10-16 15:59:58 -05:00
committed by Paweł Domas
parent ff2626723a
commit 26dc6a4ac2
4 changed files with 15 additions and 14 deletions
@@ -63,13 +63,13 @@ export default class JitsiMeetLogStorage {
for (let i = 0, len = logEntries.length; i < len; i++) {
const logEntry = logEntries[i];
if (typeof logEntry === 'object') {
// Aggregated message
logMessage += `(${logEntry.count}) ${logEntry.text}\n`;
} else {
// Regular message
logMessage += `${logEntry}\n`;
if (logEntry.timestamp) {
logMessage += `${logEntry.timestamp} `;
}
if (logEntry.count > 1) {
logMessage += `(${logEntry.count}) `;
}
logMessage += `${logEntry.text}\n`;
}
logMessage += '"}';
@@ -39,7 +39,8 @@ function buildTransport() {
'warn',
'error'
].reduce((logger, logName) => {
logger[logName] = (...args: Array<string>) => {
logger[logName] = (timestamp: string, ...args: Array<string>) => {
// It ignores the timestamp argument, because LogBridge will add it on the native side anyway
const nargs = args.map(arg => {
if (arg instanceof Error) {
const errorBody = {