Python set verbose

30 Python code examples are found related to " set verbose". You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.
Example 1
Source File: connection.py    From w3af-api-client with GNU General Public License v2.0 9 votes vote down vote up
def set_verbose(self, verbose):
        # Get level based on verbose boolean
        level = logging.DEBUG if verbose else logging.CRITICAL

        # Configure my own logger
        api_logger.setLevel(level=level)

        ch = logging.StreamHandler()
        ch.setLevel(level)

        formatter = logging.Formatter('%(message)s')
        ch.setFormatter(formatter)
        api_logger.addHandler(ch)

        # Configure the loggers for urllib3, requests and httplib
        requests_log = logging.getLogger("requests.packages.urllib3")
        requests_log.setLevel(level)
        requests_log.propagate = True

        requests_log = logging.getLogger("requests")
        requests_log.setLevel(level)

        http_client.HTTPConnection.debuglevel = 1 if verbose else 0 
Example 2
Source File: log.py    From cyaron with GNU Lesser General Public License v3.0 7 votes vote down vote up
def set_verbose():
    """set log mode to "verbose" """
    register_logfunc('debug', _default_debug)
    register_logfunc('info', _default_info)
    register_logfunc('print', _default_print)
    register_logfunc('warn', _default_warn)
    register_logfunc('error', _default_error) 
Example 3
Source File: util.py    From GraphRicciCurvature with Apache License 2.0 7 votes vote down vote up
def set_verbose(verbose="ERROR"):
    """Set up the verbose level of the GraphRicciCurvature.

    Parameters
    ----------
    verbose: {"INFO","DEBUG","ERROR"}
        Verbose level. (Default value = "ERROR")
            - "INFO": show only iteration process log.
            - "DEBUG": show all output logs.
            - "ERROR": only show log if error happened.
    """
    if verbose == "INFO":
        logger.setLevel(logging.INFO)
    elif verbose == "DEBUG":
        logger.setLevel(logging.DEBUG)
    elif verbose == "ERROR":
        logger.setLevel(logging.ERROR)
    else:
        print('Incorrect verbose level, option:["INFO","DEBUG","ERROR"], use "ERROR instead."')
        logger.setLevel(logging.ERROR) 
Example 4
Source File: WebApp.py    From RENAT with Apache License 2.0 7 votes vote down vote up
def set_verbose(self,verbose=False):
        """ Set current verbose mode to ``verbose``
        """
        self._verbose = verbose
        BuiltIn().log('Set verbose mode to `%s`' % self._verbose) 
Example 5
Source File: init.py    From boss with MIT License 6 votes vote down vote up
def set_verbose_logging():
    ''' Turn verbose loggingon. '''
    import logging
    from fabric.network import ssh

    logging.basicConfig(level=logging.DEBUG)
    ssh.util.log_to_file('paramiko.log') 
Example 6
Source File: j1939.py    From CanCat with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def setReprVerbosePGNs(self, pgnlist):
        '''
        provide a list of s which should be printed
        '''
        if pgnlist == 'ON':
            self._repr_all_spns = True
        elif pgnlist == 'OFF':
            self._repr_all_spns = False
        elif type(pgnlist) == list:
            self._repr_spns_by_pgn = {pgn:True for pgn in pgnlist}
        elif pgnlist is None:
            self._repr_spns_by_pgn = {}
            self._repr_all_spns = False 
Example 7
Source File: network.py    From natlas with GNU General Public License v2.0 6 votes vote down vote up
def set_verbose(self, level):
        '''
        Set the verbose output level for discovery output.

        Args:
            Level       0 = no output
                        1 = normal output
        '''
        self.verbose = level 
Example 8
Source File: HandlerUtil.py    From azure-linux-extensions with Apache License 2.0 6 votes vote down vote up
def set_verbose_log(self, verbose):
        if(verbose == "1" or verbose == 1):
            self.log("Enable verbose log")
            LoggerInit(self._context._log_file, '/dev/stdout', verbose=True)
        else:
            self.log("Disable verbose log")
            LoggerInit(self._context._log_file, '/dev/stdout', verbose=False) 
Example 9
Source File: config.py    From l293d with MIT License 6 votes vote down vote up
def set_verbose(cls, value):
        if type(value) == bool:
            cls.__verbose = value
        else:
            raise TypeError('verbose must be either True or False') 
Example 10
Source File: archivebot.py    From archivebot with MIT License 6 votes vote down vote up
def set_verbose(event, session):
    """Set the verbosity for this chat."""
    subscriber, verbose = await get_option_for_subscriber(event, session)
    if subscriber is None:
        return

    subscriber.verbose = verbose
    return f"I'm now configured to be {'verbose' if verbose else 'sneaky'}." 
Example 11
Source File: wagon.py    From wagon with Apache License 2.0 6 votes vote down vote up
def set_verbose():
    # TODO: This is a very naive implementation. We should really
    # use a logging configuration based on different levels of
    # verbosity.
    # The default level should be something in the middle and
    # different levels of `--verbose` and `--quiet` flags should be
    # supported.
    global verbose
    verbose = True 
Example 12
Source File: fdw.py    From bigquery_fdw with MIT License 6 votes vote down vote up
def setOptionVerbose(self, verbose):
        """
            Set a flag `self.verbose` as `True` if `verbose` contains the string 'true'
            Otherwise, set it as `False`
        """

        if verbose == 'true':
            self.verbose = True
            return

        self.verbose = False 
Example 13
Source File: tools.py    From recipe-robot with Apache License 2.0 6 votes vote down vote up
def set_verbose_mode(cls, value):
        """Set the class variable for verbose_mode."""
        if isinstance(value, bool):
            cls.verbose_mode = value
        else:
            raise ValueError 
Example 14
Source File: stateful_browser.py    From MechanicalSoup with MIT License 6 votes vote down vote up
def set_verbose(self, verbose):
        """Set the verbosity level (an integer).

        * 0 means no verbose output.
        * 1 shows one dot per visited page (looks like a progress bar)
        * >= 2 shows each visited URL.
        """
        self.__verbose = verbose 
Example 15
Source File: pipark_setup.py    From PiPark with GNU General Public License v2.0 6 votes vote down vote up
def setIsVerbose(value):
        if isinstance(value, bool): self.__is_verbose = value


# ==============================================================================
#
#   Run Main Program
#
# ============================================================================== 
Example 16
Source File: log.py    From firehorse with Apache License 2.0 6 votes vote down vote up
def setVerbose(more = False):
    global level
    level = more and TRACE or logging.DEBUG
    logfile.setLevel(level)
    con.setLevel(level) 
Example 17
Source File: util.py    From blobxfer with MIT License 6 votes vote down vote up
def set_verbose_logger_handlers():  # noqa
    # type: (None) -> None
    """Set logger handler formatters to more detail"""
    global _REGISTERED_LOGGER_HANDLERS
    formatter = logging.Formatter(
        '%(asctime)s %(levelname)s %(name)s:%(funcName)s:%(lineno)d '
        '%(message)s')
    formatter.default_msec_format = '%s.%03d'
    for handler in _REGISTERED_LOGGER_HANDLERS:
        handler.setFormatter(formatter) 
Example 18
Source File: server.py    From biomart with BSD 2-Clause "Simplified" License 6 votes vote down vote up
def set_verbose(self, value):
        if not isinstance(value, bool):
            raise biomart.BiomartException("verbose must be set to a boolean value")

        setattr(self, '_verbose', value)

        # propagate verbose state to databases and datasets objects
        for database in self._databases.values():
            database.verbose = True

        for dataset in self._datasets.values():
            dataset.verbose = True 
Example 19
Source File: ModuleLogger.py    From royal-chaos with MIT License 6 votes vote down vote up
def set_verbose(self, verbose):
        """ Sets verbosity level."""
        
        self._verbose = verbose if verbose <= 2 else 2
        
    # empty implementations, to be re-implemented by the descendants 
Example 20
Source File: core.py    From pycopia with Apache License 2.0 6 votes vote down vote up
def set_verbose(self, level=1):
        """Turn on or off the VERBOSE flag.

        Make reports more, or less, verbose at run time.
        """
        ov = self._verbose
        self._verbose = self.config.flags.VERBOSE = level
        return ov

    # for checking verbosity in tests. 
Example 21
Source File: cpp_lint.py    From Deep-Exemplar-based-Colorization with MIT License 6 votes vote down vote up
def SetVerboseLevel(self, level):
    """Sets the module's verbosity, and returns the previous setting."""
    last_verbose_level = self.verbose_level
    self.verbose_level = level
    return last_verbose_level 
Example 22
Source File: solver_cma.py    From osim-rl with MIT License 6 votes vote down vote up
def set_verbose(self, verbose):
        self.verbose = verbose
        if verbose:
            self.options['verb_disp'] = 1
        else:
            self.options['verb_disp'] = 0 
Example 23
Source File: util.py    From batch-shipyard with MIT License 6 votes vote down vote up
def set_verbose_logger_handlers():
    # type: (None) -> None
    """Set logger handler formatters to more detail"""
    global _REGISTERED_LOGGER_HANDLERS
    formatter = logging.Formatter(
        '%(asctime)s %(levelname)s %(name)s:%(funcName)s:%(lineno)d '
        '%(message)s')
    formatter.default_msec_format = '%s.%03d'
    for handler in _REGISTERED_LOGGER_HANDLERS:
        handler.setFormatter(formatter) 
Example 24
Source File: utils_libguestfs.py    From avocado-vt with GNU General Public License v2.0 6 votes vote down vote up
def set_verbose(self, verbose):
        """
        set-verbose - set verbose mode

        If "verbose" is true, this turns on verbose messages.
        """
        return self.inner_cmd('set_verbose %s' % verbose) 
Example 25
Source File: wicc_control.py    From WiCC with GNU General Public License v3.0 6 votes vote down vote up
def set_verbose_level(self, level):
        """
        Sets the class variable for the verbose level
        :param level: verbose level to set
        :return: None

        :Author: Miguel Yanes Fernández
        """
        self.verbose_level = level