<commit_before>var fs = require("fs")
var http = require('http')
var path = require("path")
var url = require("url")

// load static assets
function load(name, media_type) {
  return [fs.readFileSync(__dirname + "/asset/" + name), media_type]
}
var static = {
  'raphael': load('raphael-min.js', 'application/javascript'),
  'g.raphael': load('g.raphael-min.js', 'application/javascript'),
  'jquery': load('jquery-min.js', 'application/javascript'),
  'jquery-ui': load('jquery-ui-min.js', 'application/javascript'),
  'jquery-ui-style': load('jquery-ui.css', 'text/css'),
  'htracr-style': load('htracr.css', 'text/css'),
  'htracr-client': load('htracr-client.js', "application/javascript"),
  'ui-icons_cccccc_256x240.png': load(
    'ui-icons_cccccc_256x240.png', "image/png"
  ),
  'ui-bg_inset-soft_25_000000_1x100.png': load(
    'ui-bg_inset-soft_25_000000_1x100.png', 'image/png'
  ),
  'ui-bg_glass_20_555555_1x400.png': load(
    'ui-bg_glass_20_555555_1x400.png', 'image/png'
  ),
  'ui-bg_glass_40_0078a3_1x400.png': load(
    'ui-bg_glass_40_0078a3_1x400.png', 'image/png'
  ),
  'ui-bg_inset-soft_30_f58400_1x100.png': load(
    'ui-bg_inset-soft_30_f58400_1x100.png', 'image/png'
  ),
  '': load('htracr.html', 'text/html'),
}
  
function req_done(request, response, htracr) {
  var path = url.parse(request.url).pathname
  var path_segs = path.split("/")
  path_segs.shift()
  var seg = path_segs.shift()
  switch (seg) {
    case 'start':
      try {
        htracr.start_capture()
      } catch (e) {
        response.writeHead(500, {'content-type': 'text/plain'})
        response.end(e.description)
        return
      }
      response.writeHead(200, {'content-type': 'text/plain'})
      response.end()<commit_msg>log exceptions to start to console as well<commit_after>var fs = require("fs")
var http = require('http')
var path = require("path")
var url = require("url")

// load static assets
function load(name, media_type) {
  return [fs.readFileSync(__dirname + "/asset/" + name), media_type]
}
var static = {
  'raphael': load('raphael-min.js', 'application/javascript'),
  'g.raphael': load('g.raphael-min.js', 'application/javascript'),
  'jquery': load('jquery-min.js', 'application/javascript'),
  'jquery-ui': load('jquery-ui-min.js', 'application/javascript'),
  'jquery-ui-style': load('jquery-ui.css', 'text/css'),
  'htracr-style': load('htracr.css', 'text/css'),
  'htracr-client': load('htracr-client.js', "application/javascript"),
  'ui-icons_cccccc_256x240.png': load(
    'ui-icons_cccccc_256x240.png', "image/png"
  ),
  'ui-bg_inset-soft_25_000000_1x100.png': load(
    'ui-bg_inset-soft_25_000000_1x100.png', 'image/png'
  ),
  'ui-bg_glass_20_555555_1x400.png': load(
    'ui-bg_glass_20_555555_1x400.png', 'image/png'
  ),
  'ui-bg_glass_40_0078a3_1x400.png': load(
    'ui-bg_glass_40_0078a3_1x400.png', 'image/png'
  ),
  'ui-bg_inset-soft_30_f58400_1x100.png': load(
    'ui-bg_inset-soft_30_f58400_1x100.png', 'image/png'
  ),
  '': load('htracr.html', 'text/html'),
}
  
function req_done(request, response, htracr) {
  var path = url.parse(request.url).pathname
  var path_segs = path.split("/")
  path_segs.shift()
  var seg = path_segs.shift()
  switch (seg) {
    case 'start':
      try {
        htracr.start_capture()
      } catch (e) {
        response.writeHead(500, {'content-type': 'text/plain'})
        response.end(e.description)
        console.log("Problem starting capture: " + e)
        return
      }
      response.writeHead(200, {'content-type': 'text/plain'})
      response.end()
{'fraction_non_alphanumeric': 0.18179263838156787, 'fraction_numerical': 0.061815116605788145, 'mean_word_length': 4.0070323488045005, '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': '5343998', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1373, 'n_words': 208}