Skip to content

Commit

Permalink
fixed [Value in log is not string data type]
Browse files Browse the repository at this point in the history
  • Loading branch information
WFLJQ committed Oct 13, 2022
1 parent f9634cc commit 8fe799b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/log/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ class SendLog {
};
let logs = { ...extraData, ...data };
for (let key in logs) {
if (typeof logs[key] === 'number') {
logs[key] = "" + logs[key];
}
// Value in log is not string data type
if (typeof logs[key] === 'number') {
logs[key] = "" + logs[key];
}
if (logs[key] === null) {
logs[key] = ""
}
if(Object.prototype.toString.call(logs[key]) === '[object Object]'){
logs[key] = JSON.stringify(logs[key])
}
}
return logs
}
Expand Down

0 comments on commit 8fe799b

Please sign in to comment.