chore: use logger for all important logs

This commit is contained in:
André Sá 2021-10-08 19:04:24 +01:00
parent 6f73606cfb
commit 21bdf5f60a
16 changed files with 51 additions and 39 deletions

View file

@ -2,6 +2,7 @@ const jaro = require('talisman/metrics/distance/jaro')
const _ = require('lodash/fp')
const debugLog = require('../pp')(__filename) // KOSTIS TODO: remove
const logger = require('../logger')
const stringSimilarity = _.curry(jaro)
@ -62,7 +63,7 @@ function match (structs, candidate, options) {
const phoneticScore = phoneticMatches.has(aliasId) ? 1 : -1
const finalScore = stringWeight * stringScore + phoneticWeight * phoneticScore
verbose && console.log(finalScore.toFixed(2), stringScore.toFixed(2), phoneticScore.toFixed(2), word.value, wordEntry.value)
verbose && logger.debug(finalScore.toFixed(2), stringScore.toFixed(2), phoneticScore.toFixed(2), word.value, wordEntry.value)
if (finalScore >= threshold) {
const entry = {aliasId, score: finalScore, word: word.value, value: wordEntry.value}