function logMessage(level, filename, position, message, extra) {
  let logMsg = {
    filename: filename,
    position: position,
    message: message,
    extra: extra,
  };
  let fileLoc = chalk.cyan(filename);
  level = level.toUpperCase();
  if (position && position.line) {
    fileLoc += chalk.gray('#') + chalk.cyan(position.line);
  }
  if (level === 'ERROR') {
    gutil.log(chalk.red('ERROR:'), fileLoc, message);
    allErrors.push(logMsg);
  } else {
    gutil.log(chalk.yellow('WARNING:'), fileLoc, message);
    allWarnings.push(logMsg);
  }
  if (global.WF.options.verbose && extra) {
    // eslint-disable-next-line no-console
    console.log(extra);
  }
  filesWithIssues[filename] = true;
}
Logs a message to the console

@param {string} level ERROR or WARNING, the level of the error
@param {string} filename The file the issue occurred in
@param {Object} position The line/column the error occurred on
@param {string} message The message to be displayed
@param {Object} extra Any extra information to show