<commit_before>'use strict';

var mongoose = require('mongoose');
var Tactics = mongoose.model('Tactics');

exports.create = function (req, res) {
    var tactics = new Tactics(req.body);
    tactics.save(function (err, data) {
        if (err) {
            res.send(400);
        } else {
            res.location('/api/tactics/' + data._id);
            res.send(201, data.getPublicFields());
        }
    });
};

exports.findOne = function (req, res) {
    Tactics.findOne({ _id: req.params.id }, function (err, data) {
        if (err || !data) {
            res.send(404);
        } else {
            res.send(200, data.getPublicFields());
        }
    });
};<commit_msg>Increase logging<commit_after>'use strict';

var mongoose = require('mongoose');
var Tactics = mongoose.model('Tactics');

exports.create = function (req, res) {
    var tactics = new Tactics(req.body);
    tactics.save(function (err, data) {
        if (err) {
            console.log(req.headers, req.body, err);
            res.send(400);
        } else {
            res.location('/api/tactics/' + data._id);
            res.send(201, data.getPublicFields());
        }
    });
};

exports.findOne = function (req, res) {
    Tactics.findOne({ _id: req.params.id }, function (err, data) {
        if (err || !data) {
            if (err) {
                console.log(req.headers, req.body, err);
            }
            res.send(404);
        } else {
            res.send(200, data.getPublicFields());
        }
    });
};
{'fraction_non_alphanumeric': 0.16423841059602648, 'fraction_numerical': 0.015894039735099338, 'mean_word_length': 1.998015873015873, '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': '5266023', 'n_tokens_mistral': 503, 'n_tokens_neox': 494, 'n_words': 97}