<commit_before>/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

var noop = function () {}

module.exports = {
  trace: noop,
  debug: noop,
  info: noop,
  warn: noop,
  error: noop,
  stat: noop
}<commit_msg>fix(tests): enforce mozlog rules in test logger<commit_after>/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

const assert = require('assert');

// all the promise wrapping in tests makes it unclear who actually 
// called mozlog incorrectly. So, record this location directly.
function getMozlogCallerLocation() {
  var err = new Error('getMozlogCallerLocation').stack.split('\n')[3]
  return err
}

// no-op except check that first arg is a string, etc., a la mozlog
var noop = function () {
  assert(arguments.length <= 2, 'mozlog takes a maximum of 2 arguments' + 
         ', caller: ' + getMozlogCallerLocation())
  assert.equal(typeof arguments[0], 'string',
               'mozlog must take a String as first argument, got: ' + 
               JSON.stringify(arguments[0]) + ', caller: ' + getMozlogCallerLocation())
  assert.equal(arguments[0].indexOf(' '), -1,
               'mozlog first argument must not contain spaces, got "' +
               JSON.stringify(arguments[0]) + '"' + 
               ', caller: ' + getMozlogCallerLocation())
}

module.exports = {
  trace: noop,
  debug: noop,
  info: noop,
  warn: noop,
  error: noop,
  stat: noop
}
{'fraction_non_alphanumeric': 0.1301140174379611, 'fraction_numerical': 0.008048289738430584, 'mean_word_length': 3.179271708683473, 'pattern_counts': {'":': 0, '<': 4, '<?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': '4391358', 'n_tokens_mistral': 472, 'n_tokens_neox': 461, 'n_words': 140}