Skip to content

Commit

Permalink
system-logging: Merge arguments of an unique console call
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl authored and patrickelectric committed Jan 16, 2024
1 parent 650e19d commit f8d3f98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libs/system-logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ if (enableSystemLogging === 'true') {
// @ts-ignore
window.console[level] = (...o: any[]) => {
fn(...o)
let wholeMessage = ''
o.forEach((m) => {
let msg = m
try {
Expand All @@ -63,9 +64,11 @@ if (enableSystemLogging === 'true') {
msg = ''
}
if (msg !== '') {
saveLogEventInDB({ epoch: new Date().getTime(), level: level, msg: msg })
wholeMessage += ' '
wholeMessage += msg
}
})
saveLogEventInDB({ epoch: new Date().getTime(), level: level, msg: wholeMessage })
}
})
}

0 comments on commit f8d3f98

Please sign in to comment.