def chown_log_dir(uid, gid):
  """
  chown all files in the log dir to this user and group.
  Should only be called after loggic has been setup.
  Return success
  """
  if _log_dir is None:
    return False

  try:
    os.chown(_log_dir, uid, gid)
    for entry in os.listdir(_log_dir):
      os.chown(os.path.join(_log_dir, entry), uid, gid)
    return True
  except __HOLE__, ex:
    print >> sys.stderr, 'Failed to chown log directory %s: ex' % (_log_dir, ex)
    return False
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/log/__init__.py/chown_log_dir