Browse Source

feat(log): add structured data to address parser logs

These logs have been very confusing to us for a long time, and we have
never bothered to collect enought data to understand them better.
pull/1220/head
Julian Simioni 6 years ago
parent
commit
003c182df5
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 4
      query/text_parser_addressit.js
  2. 8
      sanitizer/_text_addressit.js

4
query/text_parser_addressit.js

@ -30,7 +30,9 @@ function addParsedVariablesToQueryVariables( parsed_text, vs ){
// ?
else {
logger.warn( 'chaos monkey asks: what happens now?' );
logger.warn( 'chaos monkey asks: what happens now?', {
parsed_text: parsed_text
});
}
// ==== add parsed matches [address components] ====

8
sanitizer/_text_addressit.js

@ -108,9 +108,11 @@ function parse(query) {
});
// if all we found was regions, ignore it as it is not enough information to make smarter decisions
if (Object.keys(parsed_text).length === 1 && !_.isUndefined(parsed_text.regions))
{
logger.info('Ignoring address parser output, regions only');
if (Object.keys(parsed_text).length === 1 && !_.isUndefined(parsed_text.regions)) {
logger.info('Ignoring address parser output, regions only', {
text: query.text,
parsed: parsed_text
});
return null;
}

Loading…
Cancel
Save