<commit_before>const bunyan = require('bunyan')
const uuid = require('uuid').v4

const mainLogger = bunyan.createLogger({name: 'MAPGEN'})

const requestLogger = mainLogger.child({component: 'REQUEST'})

const logRequestMiddleware = (req, res, next) => {
  const startTime = process.hrtime()
  
  req.uuid = uuid()
  
  requestLogger.info(req.uuid.substr(0, 8), req.method, req.originalUrl)
  res.on('finish', function responseSent() {
    const diff = process.hrtime(startTime);
    const responseData = {
      duration: diff[0] * 1e3 + diff[1] * 1e-6,
      statusCode: res.statusCode,
      statusMessage: res.statusMessage
    }

    if (res.statusCode < 400) {
      requestLogger.info(req.uuid.substr(0, 8), 'response sent', responseData)
    } else if (res.statusCode < 500) {
      requestLogger.warn(req.uuid.substr(0, 8), 'response sent', responseData)
    } else {
      requestLogger.error(req.uuid.substr(0, 8), 'response sent', responseData)
    }
  })
  next()
}

module.exports = {
  main: mainLogger,
  logRequestMiddleware
}<commit_msg>Remove extra semicolon<commit_after>const bunyan = require('bunyan')
const uuid = require('uuid').v4

const mainLogger = bunyan.createLogger({name: 'MAPGEN'})

const requestLogger = mainLogger.child({component: 'REQUEST'})

const logRequestMiddleware = (req, res, next) => {
  const startTime = process.hrtime()
  
  req.uuid = uuid()
  
  requestLogger.info(req.uuid.substr(0, 8), req.method, req.originalUrl)
  res.on('finish', function responseSent() {
    const diff = process.hrtime(startTime)
    const responseData = {
      duration: diff[0] * 1e3 + diff[1] * 1e-6,
      statusCode: res.statusCode,
      statusMessage: res.statusMessage
    }

    if (res.statusCode < 400) {
      requestLogger.info(req.uuid.substr(0, 8), 'response sent', responseData)
    } else if (res.statusCode < 500) {
      requestLogger.warn(req.uuid.substr(0, 8), 'response sent', responseData)
    } else {
      requestLogger.error(req.uuid.substr(0, 8), 'response sent', responseData)
    }
  })
  next()
}

module.exports = {
  main: mainLogger,
  logRequestMiddleware
}
{'fraction_non_alphanumeric': 0.14319470699432893, 'fraction_numerical': 0.01984877126654064, 'mean_word_length': 3.778781038374718, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2579280', 'n_tokens_mistral': 721, 'n_tokens_neox': 701, 'n_words': 148}