def METHOD_NAME(self, level):
    if level not in LogLevel.__members__:
        raise ValueError("invalid log level {}".format(level))
    self._write_header(Request.SetLogFilter)
    self._write_int8(getattr(LogLevel, level).value)
    self._read_expect(Reply.Success)