<commit_before>/**
 * Allows us to see console log on the ios app.
 */
export default class DebugBox {
  box: HTMLElement;

  constructor() {
    this.init();
  }

  private $(message: string): HTMLElement {
    let el = document.createElement('div');
    el.textContent = message;
    return el;
  }

  init(): void {
    this.box = this.$('');
    this.box.id = 'debug-box';
    document.body.appendChild(this.box);

    let log = window.console.log.bind(window.console);
    window.console.log = (...args) => {
      log(...args);
      this.box.appendChild(this.$(args.join(', ')));
    }
  }
}<commit_msg>wrap console error as well for ios debug boc<commit_after>/**
 * Allows us to see console log on the ios app.
 */
export default class DebugBox {
  box: HTMLElement;

  constructor() {
    this.init();
  }

  private $(message: string): HTMLElement {
    let el = document.createElement('div');
    el.textContent = message;
    return el;
  }

  init(): void {
    this.box = this.$('');
    this.box.id = 'debug-box';
    document.body.appendChild(this.box);

    let log = window.console.log.bind(window.console);
    window.console.log = (...args) => {
      log(...args);
      this.box.appendChild(this.$(args.join(', ')));
    }

    let err = window.console.error.bind(window.console);
    window.console.error = (...args) => {
      err(...args);
      this.box.appendChild(this.$(args.join(', ')));
    }
  }
}
{'fraction_non_alphanumeric': 0.1797202797202797, 'fraction_numerical': 0.0, 'mean_word_length': 2.6412213740458017, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '4978089', 'n_tokens_mistral': 479, 'n_tokens_neox': 472, 'n_words': 103}