def GetUnixErrorOutput(filename, error, new_error=False):
  """Get a output line for an error in UNIX format."""

  line = ''

  if error.token:
    line = '%d' % error.token.line_number

  error_code = '%04d' % error.code
  if new_error:
    error_code = 'New Error ' + error_code
  return '%s:%s:(%s) %s' % (filename, line, error_code, error.message)