Did I find the right examples for you? yes no

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Add logging options to an argparse ArgumentParser.

Each formatter has a corresponding option of the form --log-{name}
where {name} is the name of the formatter. The option takes a value
which is either a filename or "-" to indicate stdout.

:param parser: The ArgumentParser object that should have logging
               options added.

        def add_logging_group(parser):
    """
    Add logging options to an argparse ArgumentParser.

    Each formatter has a corresponding option of the form --log-{name}
    where {name} is the name of the formatter. The option takes a value
    which is either a filename or "-" to indicate stdout.

    :param parser: The ArgumentParser object that should have logging
                   options added.
    """
    group = parser.add_argument_group("Output Logging",
                                      description="Options for logging output.\n"
                                      "Each option represents a possible logging format "
                                      "and takes a filename to write that format to, "
                                      "or '-' to write to stdout.")
    for name, (cls, help_str) in log_formatters.iteritems():
        group.add_argument("--log-" + name, action="append", type=log_file,
                           help=help_str)
        


src/w/p/wptrunner-0.2.5/wptrunner/wptcommandline.py   wptrunner(Download)
    parser.add_argument("--product", action="store", choices=["firefox", "servo", "b2g"],
                        default="firefox")
    commandline.add_logging_group(parser)
    return parser