Fix #6179 Initializing default logger (#6186)

* Fix #6179 Initializing default logger

Fixes: #6179

Removes unnessary logs

* fix typo

* if error just write to console
This commit is contained in:
Diamond Lewis
2019-11-07 17:41:34 -06:00
committed by GitHub
parent 78f76cbcd9
commit a2d332f698
4 changed files with 39 additions and 45 deletions

View File

@@ -1,7 +1,6 @@
// Helper functions for accessing the twitter API.
var OAuth = require('./OAuth1Client');
var Parse = require('parse/node').Parse;
var logger = require('../../logger').default;
// Returns a promise that fulfills iff this user id is valid.
function validateAuthData(authData, options) {
@@ -37,10 +36,6 @@ function handleMultipleConfigurations(authData, options) {
if (Array.isArray(options)) {
const consumer_key = authData.consumer_key;
if (!consumer_key) {
logger.error(
'Twitter Auth',
'Multiple twitter configurations are available, by no consumer_key was sent by the client.'
);
throw new Parse.Error(
Parse.Error.OBJECT_NOT_FOUND,
'Twitter auth is invalid for this user.'
@@ -51,10 +46,6 @@ function handleMultipleConfigurations(authData, options) {
});
if (options.length == 0) {
logger.error(
'Twitter Auth',
'Cannot find a configuration for the provided consumer_key'
);
throw new Parse.Error(
Parse.Error.OBJECT_NOT_FOUND,
'Twitter auth is invalid for this user.'