From 179cfa6918a62e94664823fb398d616c0d1c522e Mon Sep 17 00:00:00 2001 From: Alec Vulfson Date: Thu, 18 Aug 2016 14:55:08 -0400 Subject: [PATCH] Add configuration for suspect records log --- src/lookupStream.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/lookupStream.js b/src/lookupStream.js index 0195493..072ee66 100644 --- a/src/lookupStream.js +++ b/src/lookupStream.js @@ -6,15 +6,19 @@ var regions = require('../data/regions'); var peliasLogger = require( 'pelias-logger' ); var getAdminLayers = require( './getAdminLayers' ); -var logger = peliasLogger.get( 'wof-admin-lookup', { - transports: [ - new peliasLogger.winston.transports.File( { - filename: 'suspect_wof_records.log', - timestamp: false - }) - ] -}); +//defaults to nowhere +var optsArg = { + transports: [] +}; +//only prints to suspect records log if flag is set +if (peliasConfig.logger.suspectFile === true){ + optsArg.transports.push(new peliasLogger.winston.transports.File( { + filename: 'suspect_wof_records.log', + timestamp: false + })); +} +var logger = peliasLogger.get( 'wof-admin-lookup', optsArg ); countries.isSupported = function(country) { return this.hasOwnProperty(country);