code: def profiling_level(self, session=None):
          
          result = self.command("profile", -1, session=session)
  
          assert result["was"] >= 0 and result["was"] <= 2
          return result["was"]
docs: Get the database's current profiling level.
  
          Returns one of (:data:`~pymongo.OFF`,
          :data:`~pymongo.SLOW_ONLY`, :data:`~pymongo.ALL`).
  
          :Parameters:
            - `session` (optional): a
              :class:`~pymongo.client_session.ClientSession`.
  
          .. versionchanged:: 3.6
             Added ``session`` parameter.
  
          .. mongodoc:: profiling