Skip to content

Commit

Permalink
API-1 - Logging API codeless block improvement(fixed convert function…
Browse files Browse the repository at this point in the history
… and tests)
  • Loading branch information
macbookpro committed Feb 26, 2024
1 parent ef82afd commit 3a3814a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/logging/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ export default class Logging {
}

function convertMessageToString(message) {
if (typeof message === 'string') {
return message
}

if (typeof message === 'undefined') {
return 'undefined'
}
Expand All @@ -173,9 +177,5 @@ function convertMessageToString(message) {
return Object.prototype.toString.call(message)
}

if (typeof message !== 'string') {
return JSON.stringify(message)
}

return message
return JSON.stringify(message)
}

0 comments on commit 3a3814a

Please sign in to comment.