"""Adds the verbosity command line option to the given parser.
"""Adds the verbosity command line option to the given parser.
The verbosity can by set to 0 (error), 1 (warning), 2 (info) or 3 (debug) by including the according number of --verbose command line arguments (e.g., ``-vv`` for info level).
The verbosity can by set to 0 (error), 1 (warning), 2 (info) or 3 (debug) by
including the according number of --verbose command line arguments (e.g.,
**Parameters:**
``-vv`` for info level).
``parser`` : :py:class:`argparse.ArgumentParser` or one of its derivatives
Parameters
A command line parser that you want to add a verbose option to
----------
parser : :py:class:`argparse.ArgumentParser` or one of its derivatives
``short_option`` : str
A command line parser that you want to add a verbose option to
The short command line option that should be used for increasing the verbosity.
short_option : :obj:`str`, optional
By default, ``'-v'`` is considered as the shortcut
The short command line option that should be used for increasing the
"""
verbosity. By default, ``'-v'`` is considered as the shortcut
help="Increase the verbosity level from 0 (only error messages) to 1 (warnings), 2 (log messages), 3 (debug information) by adding the --verbose option as often as desired (e.g. '-vvv' for debug).")
defset_verbosity_level(logger,level):
"""Sets the log level for the given logger.
**Parameters:**
``logger`` : :py:class:`logging.Logger` or str
The logger to generate logs for, or the name of the module to generate logs for.