Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit b381cbf

Browse files
Improve logs for debugging
1 parent 0b99b93 commit b381cbf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/services/ProcessorService.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ async function createAchievement (userId, providerName, certifierId, certifiedDa
191191
*/
192192
async function createUserAttributes (userId, record) {
193193
let i = 1
194-
logger.debug(`*** createUserAttributes('${userId}','${record}')`)
194+
logger.debug(`*** createUserAttributes('${userId}','${JSON.stringify(record)}')`)
195195
while (record[`attributeValue${i}`]) {
196196
logger.debug(`*** createUserAttributes: record number${i}`)
197197

@@ -204,7 +204,7 @@ async function createUserAttributes (userId, record) {
204204
const attributeGroup = await helper.getUbahnSingleRecord('/attributeGroups', { name: record[`attributeGroupName${i}`] })
205205
const attribute = await helper.getUbahnSingleRecord('/attributes', { attributeGroupId: attributeGroup.id, name: record[`attributeName${i}`] })
206206
const value = _.toString(record[`attributeValue${i}`])
207-
logger.debug(`*** createUserAttributes: attribute/value = ${attribute}/${value}`)
207+
logger.debug(`*** createUserAttributes: attribute/value = ${JSON.stringify(attribute)}/${value}`)
208208

209209
const existingAttribute = await helper.getUbahnSingleRecord(`/users/${userId}/attributes/${attribute.id}`, {}, true)
210210

@@ -215,6 +215,7 @@ async function createUserAttributes (userId, record) {
215215
}
216216
i++
217217
}
218+
logger.debug(`No more attributes to process. Stopped at index ${i}`)
218219
}
219220

220221
/**

0 commit comments

Comments
 (0)