<commit_before>'use strict';

/**
 * Module dependencies.
 */

/**
 * Create a Log
 * { message: 'xxx', logType: 'warn' }
 */
exports.log = function(req, res) {
  var msg = req.body;

  if (!msg) {
    res.status(400).send({
      message: 'invalid request'
    });
  } else {
    //use console so I can pick up information in log file on heroku
    console[msg.logType]('client %s: %s', msg.logType, msg.message);

    return res.status(200).end();
  }
};
<commit_msg>Adding support to log objects from the client<commit_after>'use strict';

/**
 * Module dependencies.
 */

/**
 * Create a Log
 * { message: 'xxx', logType: 'warn' }
 */
exports.log = function(req, res) {
  var msg = req.body;

  if (!msg) {
    res.status(400).send({
      message: 'invalid request'
    });
  } else {
    //use console so I can pick up information in log file on heroku
    console[msg.logType]('client %s: %s', msg.logType, JSON.stringify(msg.message));

    return res.status(200).end();
  }
};

{'fraction_non_alphanumeric': 0.17139959432048682, 'fraction_numerical': 0.012170385395537525, 'mean_word_length': 2.9322709163346614, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5820388', 'n_tokens_mistral': 345, 'n_tokens_neox': 331, 'n_words': 95}