Skip to content

Commit 7184b1a

Browse files
chore: stringify JSON objects in logs (#11)
Some logs were outputting [object Object] instead of the string value, this explicitly outputs strings of objects
1 parent bacf4cf commit 7184b1a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/plugins/diffable.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,17 @@ module.exports = class Diffable extends ErrorStash {
7777
let filteredEntries = this.filterEntries()
7878
// this.log.debug(`filtered entries are ${JSON.stringify(filteredEntries)}`)
7979
return this.find().then(existingRecords => {
80-
this.log.debug(` ${JSON.stringify(existingRecords, null, 2)} \n\n ${JSON.stringify(filteredEntries, null, 2)} `)
80+
this.log.debug(` ${JSON.stringify(existingRecords)} \n\n ${JSON.stringify(filteredEntries)} `)
8181

8282
const mergeDeep = new MergeDeep(this.log, this.github, ignorableFields)
8383
const compare = mergeDeep.compareDeep(existingRecords, filteredEntries)
8484
const results = { msg: 'Changes found', additions: compare.additions, modifications: compare.modifications, deletions: compare.deletions }
85-
this.log.debug(`Results of comparing ${this.constructor.name} diffable target ${JSON.stringify(existingRecords)} with source ${JSON.stringify(filteredEntries)} is ${results}`)
85+
this.log.debug(`Results of comparing ${this.constructor.name} diffable target ${JSON.stringify(existingRecords)} with source ${JSON.stringify(filteredEntries)} is ${JSON.stringify(results)}`)
8686
if (!compare.hasChanges) {
87-
this.log.debug(`There are no changes for ${this.constructor.name} for repo ${this.repo}. Skipping changes`)
87+
this.log.debug(`There are no changes for ${this.constructor.name} for repo ${JSON.stringify(this.repo)}. Skipping changes`)
8888
return Promise.resolve()
89-
} else {
90-
if (this.nop) {
89+
} else if (this.nop) {
9190
resArray.push(new NopCommand(this.constructor.name, this.repo, null, results, 'INFO'))
92-
}
9391
}
9492

9593
// Filter out all empty entries (usually from repo override)

0 commit comments

Comments
 (0)