Came up with a better hacky logging system.

This commit is contained in:
Scott Erickson 2014-01-24 11:55:44 -08:00
parent c59b9d904b
commit b2366c50af

View file

@ -2,18 +2,11 @@ mail = require '../commons/mail'
map = _.invert mail.MAILCHIMP_GROUP_MAP map = _.invert mail.MAILCHIMP_GROUP_MAP
User = require '../users/User.coffee' User = require '../users/User.coffee'
errors = require '../commons/errors' errors = require '../commons/errors'
request = require 'request'
options =
from: 'scott@codecombat.com'
to: 'scott@codecombat.com'
replyTo: 'scott@codecombat.com'
subject: 'Bad log'
text: ''
badLog = (text) -> badLog = (text) ->
options.text = text options.text = text
mail.transport.sendMail options, (error) -> request.post 'http://requestb.in/1brdpaz1', { form: {log: text} }
console.error "Error sending mail: #{error.message or error}" if error
module.exports.setupRoutes = (app) -> module.exports.setupRoutes = (app) ->
app.all '/mail/webhook', (req, res) -> app.all '/mail/webhook', (req, res) ->