<commit_before>/// <reference path='../../node_modules/freedom-typescript-api/interfaces/freedom.d.ts' />

module Log {
  // From App, there might not be access to logger module. In such case,
  // use freedom for message sending.
  var logger = freedom['logger'] ? freedom['logger']() : freedom;
  var tag: string = '';

  export function setTag(t: string) {
    tag = t;
  }

  export function debug(m, ...args: any[]) {
    logger.emit('logger.debug', {tag: tag, msg: m, args: args});
  }

  export function info(m, ...args: any[]) {
    logger.emit('logger.info', {tag: tag, msg: m, args: args});
  }

  export function warn(m, ...args: any[]) {
    logger.emit('logger.warn', {tag: tag, msg: m, args: args});
  }

  export function error(m, ...args: any[]) {
    logger.emit('logger.error', {tag: tag, msg: m, args: args});
  }

  export function getLog(m: any) {
    logger.emit('logger.getLog', m);
  }

  /******************* Logger relay **********************/
  freedom['reflectEvents'] = false;

  // do relay for message received from app.
  freedom.on('logger.debug', function(m) {
    logger.emit('logger.debug', m);
  });

  freedom.on('logger.info', function(m) {
    logger.emit('logger.info', m);
  });

  freedom.on('logger.warn', function(m) {
    logger.emit('logger.warn', m);
  });

  freedom.on('logger.error', function(m) {
    logger.emit('logger.error', m);
  });

  freedom.on('logger.getLog', function(m) {
    logger.emit('logger.getLog', m);
  });

  logger.on('logger.report', function(m){
    freedom.emit('print', m);
  });

  freedom.on('')
}<commit_msg>fix a partial change.<commit_after>/// <reference path='../../node_modules/freedom-typescript-api/interfaces/freedom.d.ts' />

module Log {
  // From App, there might not be access to logger module. In such case,
  // use freedom for message sending.
  var logger = freedom['logger'] ? freedom['logger']() : freedom;
  var tag: string = '';

  export function setTag(t: string) {
    tag = t;
  }

  export function debug(m, ...args: any[]) {
    logger.emit('logger.debug', {tag: tag, msg: m, args: args});
  }

  export function info(m, ...args: any[]) {
    logger.emit('logger.info', {tag: tag, msg: m, args: args});
  }

  export function warn(m, ...args: any[]) {
    logger.emit('logger.warn', {tag: tag, msg: m, args: args});
  }

  export function error(m, ...args: any[]) {
    logger.emit('logger.error', {tag: tag, msg: m, args: args});
  }

  export function getLog(m: any) {
    logger.emit('logger.getLog', m);
  }

  /******************* Logger relay **********************/
  freedom['reflectEvents'] = false;

  // do relay for message received from app.
  freedom.on('logger.debug', function(m) {
    logger.emit('logger.debug', m);
  });

  freedom.on('logger.info', function(m) {
    logger.emit('logger.info', m);
  });

  freedom.on('logger.warn', function(m) {
    logger.emit('logger.warn', m);
  });

  freedom.on('logger.error', function(m) {
    logger.emit('logger.error', m);
  });

  freedom.on('logger.getLog', function(m) {
    logger.emit('logger.getLog', m);
  });

  logger.on('logger.report', function(m){
    freedom.emit('print', m);
  });

}
{'fraction_non_alphanumeric': 0.22201198360138757, 'fraction_numerical': 0.0, 'mean_word_length': 3.339261285909713, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5728488', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1063, 'n_words': 256}