<commit_before>exports.BlogApi = Class.create({
  initialize: function(options) {
    options = options || {};
  },  
  getPosts: function(callback) {
    jojo.logger.info('Getting posts by date from couch.');
    jojo.data.appdb.view("blogentry/posts_by_date", { descending: true }, function(err, dbResult) {
      if (!err) {
        jojo.logger.info({message:'Found ' + dbResult.length + ' posts.'});
        dbResult.forEach(function(key, doc, id) {
          debugger;
          doc.key = key;
          doc.pubDate = new Date(key[0]-0, key[1]-0, key[2]-0, key[3]-0, key[4]-0, key[5]-0);
          doc.id = id;
          jojo.logger.debug({message:'Found document w/ id ' + id + ', key ' + key});
        });
      } else {
        jojo.logger.error(err);
      }
      if (callback) {
        callback(err, dbResult);
      }
    }); // end couch.db.view
  }
  
});<commit_msg>Improved logging messages.<commit_after>exports.BlogApi = Class.create({
  initialize: function(options) {
    options = options || {};
  },  
  getPosts: function(callback) {
    jojo.logger.info('Getting posts by date from couch.');
    jojo.data.appdb.view("blogentry/posts_by_date", { descending: true }, function(err, dbResult) {
      if (!err) {
        jojo.logger.info({message:'Found ' + dbResult.length + ' posts.'});
        dbResult.forEach(function(key, doc, id) {
          debugger;
          doc.key = key;
          doc.pubDate = new Date(key[0]-0, key[1]-0, key[2]-0, key[3]-0, key[4]-0, key[5]-0);
          doc.id = id;
          jojo.logger.debug({message:'Found document w/ id ' + id + ', key ' + key});
        });
      } else {
        jojo.logger.error({message:"Error getting posts from couch", exception:err});
      }
      if (callback) {
        callback(err, dbResult);
      }
    }); // end couch.db.view
  }
  
});
{'fraction_non_alphanumeric': 0.1756683033278778, 'fraction_numerical': 0.01309328968903437, 'mean_word_length': 2.3406193078324224, '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': '189897', 'n_tokens_mistral': 623, 'n_tokens_neox': 603, 'n_words': 117}