How to use the modern-logger.debug function in modern-logger

To help you get started, we’ve selected a few modern-logger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hfreire / get-me-a-date / src / dates / dates.js View on Github external
.then((channelRecommendations) => {
        received = _.size(channelRecommendations)

        return Logger.debug(`Got ${received} recommendations from ${_.capitalize(channel.name)}`)
          .then(() => Promise.map(channelRecommendations, (channelRecommendation) => {
            const { channelRecommendationId } = channelRecommendation

            return Recommendation.checkOut(channel, channelRecommendationId, channelRecommendation)
              .then(({ recommendation, like, pass }) => likePassOrWait(channel, recommendation, like, pass))
              .then((recommendation) => recommendation.save())
              .catch(AlreadyCheckedOutEarlierError, ({ recommendation }) => {
                skipped++

                return recommendation.save()
              })
              .catch(OutOfLikesError, () => {
                skipped++
              })
              .catch((error) => {
                failed++
github hfreire / get-me-a-date / src / channels / channel.js View on Github external
onNotAuthorizedError () {
    return Logger.debug(`${_.capitalize(this._name)} got unauthorized`)
      .then(() => {
        return Database.channels.update({ accessToken: null }, { where: { name: this._name } })
          .then(() => this.authorize())
      })
  }
github hfreire / get-me-a-date / src / channels / channel.js View on Github external
.then((channel) => {
        if (channel.userId && channel.accessToken) {
          return { userId: channel.userId, accessToken: channel.accessToken }
        }

        const { clientId, redirectUri, optionalParams } = this._options.oauth.facebook

        return Logger.debug(`Started Facebook Login for ${_.capitalize(this.name)} channel`)
          .then(() => {
            return facebookLogin.oauthDialog(clientId, redirectUri, optionalParams)
              .finally(() => Logger.debug(`Finished Facebook Login for ${_.capitalize(this.name)} channel`))
          })
          .then(({ facebookAccessToken, facebookUserId }) => authorize({ facebookAccessToken, facebookUserId }))
          .then(({ userId, accessToken }) => {
            return Database.channels.update({ userId, accessToken }, { where: { name: this._name } })
              .then(() => { return { userId, accessToken } })
          })
      })
  }
github hfreire / get-me-a-date / src / channels / channel.js View on Github external
onOutOfLikesError () {
    return Logger.debug(`${_.capitalize(this.name)} is out of likes`)
      .then(() => {
        return Database.channels.update({
          isOutOfLikes: true,
          outOfLikesDate: new Date()
        }, { where: { name: this._name } })
          .then(() => {
            throw new OutOfLikesError()
          })
      })
  }
}
github hfreire / get-me-a-date / src / dates / taste.js View on Github external
.then((collectionIds) => {
        this._rekognitionCollection = this._rekognitionCollection ||
          _.find(collectionIds, (collectionId) => _.startsWith(collectionId, 'get-me-a-date-')) ||
          `get-me-a-date-${_.now()}-${_.random(9)}`

        if (!_.includes(collectionIds, this._rekognitionCollection)) {
          return Logger.debug(`Creating AWS Rekognition collection ${this._rekognitionCollection}`)
            .then(() => this._rekognition.createCollection(this._rekognitionCollection))
        }
      })
  }
github hfreire / get-me-a-date / src / channels / auth / facebook.js View on Github external
authorizeApp (email, password, url) {
    Logger.debug('Started authorizing app in Facebook')

    return RandomUserAgent.get()
      .then((userAgent) => this._authorizeAppCircuitBreaker.exec(email, password, url, userAgent))
      .finally(() => Logger.debug('Finished authorizing app in Facebook'))
  }
}
github hfreire / get-me-a-date / src / channels / auth / facebook.js View on Github external
      .finally(() => Logger.debug('Finished authorizing app in Facebook'))
  }

modern-logger

A modern logger built on top of Winston with native support for emojis and Rollbar

MIT
Latest version published 3 years ago

Package Health Score

39 / 100
Full package analysis

Similar packages