Check data before log
This commit is contained in:
parent
9de555c361
commit
d97dd315f8
|
@ -27,7 +27,7 @@ async function log({ level, tags = [], message = '', data }, store = true) {
|
|||
level,
|
||||
tags: tags.toString(),
|
||||
message,
|
||||
data: JSON.decycle(data)
|
||||
data: data ? JSON.decycle(data) : null
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const Log = {
|
||||
timestamp: parent => parent.timestamp?.toISOString(),
|
||||
data: parent => JSON.stringify(parent.data),
|
||||
data: parent => (parent.data ? JSON.stringify(parent.data) : null),
|
||||
tags: parent => parent.tags?.split(',')
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user