🌿 fix: Message Route Improvements pt. 2 (#3379)

* fix: edge case with debugTraverse function in parsers.js

* chore: Update error message in audio stream processing

* refactor: Add ONE_MINUTE and THIRTY_SECONDS options to Time enum

* fix: logging
This commit is contained in:
Danny Avila 2024-07-18 13:56:19 -04:00 committed by GitHub
parent 1acd47a0f6
commit f6125ccd59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 61 additions and 15 deletions

View file

@ -109,6 +109,14 @@ const condenseArray = (item) => {
* @returns {string} - The formatted log message.
*/
const debugTraverse = winston.format.printf(({ level, message, timestamp, ...metadata }) => {
if (!message) {
return `${timestamp} ${level}`;
}
if (!message?.trim || typeof message !== 'string') {
return `${timestamp} ${level}: ${JSON.stringify(message)}`;
}
let msg = `${timestamp} ${level}: ${truncateLongStrings(message?.trim(), 150)}`;
try {
if (level !== 'debug') {