code: def set(self, level=None):
          
          # If level specified, use given
          if level is not None:
              Logging._level = level
          # Otherwise attempt to detect from the environment
          else:
              try:
                  Logging._level = Logging.MAPPING[int(os.environ["DEBUG"])]
              except StandardError:
                  Logging._level = logging.WARN
          self.logger.setLevel(Logging._level)
docs: Set the default log level
  
          If the level is not specified environment variable DEBUG is used
          with the following meaning::
  
              DEBUG=0 ... LOG_WARN (default)
              DEBUG=1 ... LOG_INFO
              DEBUG=2 ... LOG_DEBUG
              DEBUG=3 ... LOG_DETAILS
              DEBUG=4 ... LOG_DATA
              DEBUG=5 ... LOG_ALL (log all messages)