def METHOD_NAME(proc_name, log_dir):
  """
  _read_log_conf(proc_name, log_dir) -> StringIO or None
  This method also replaces the %LOG_DIR% and %PROC_NAME% occurrences.
  """
  def _repl(match):
    if match.group(0) == '%LOG_DIR%':
      return log_dir
    elif match.group(0) == '%PROC_NAME%':
      return proc_name
  log_conf = get_desktop_root('conf', 'log.conf')
  if not os.path.isfile(log_conf):
    return None
  try:
    raw = open_file(log_conf).read()
    sio = string_io(CONF_RE.sub(_repl, raw))
    return sio
  except IOError as ex:
    print("ERROR: Failed to open %s: %s" % (log_conf, ex), file=sys.stderr)
    return None