nicfit/logger.py
def addCommandLineArgs(arg_parser):
    """Add logging option to an ArgumentParser."""
    arg_parser.register("action", "log_levels", LogLevelAction)
    arg_parser.register("action", "log_files", LogFileAction)
    arg_parser.register("action", "log_help", LogHelpAction)

    group = arg_parser.add_argument_group("Logging options")
    group.add_argument(
        "-l", "--log-level", dest="log_levels",
        action="log_levels", metavar="LOGGER:LEVEL", default=[],
        help="Set log levels for individual loggers. See --help-logging for "
             "complete details.")

    group.add_argument(
        "-L", "--log-file", dest="log_files",
        action="log_files", metavar="LOGGER:FILE", default=[],
        help="Set log the output file for individual loggers. "
             " See --help-logging for complete details.")

    group.add_argument("--help-logging", action="log_help",
                       help=argparse.SUPPRESS)
def addCommandLineArgs(arg_parser):
    arg_parser.register("action", "log_levels", LogLevelAction)
    arg_parser.register("action", "log_files", LogFileAction)
    arg_parser.register("action", "log_help", LogHelpAction)

    group = arg_parser.add_argument_group("Logging options")
    group.add_argument(
        "-l", "--log-level", dest="log_levels",
        action="log_levels", metavar="LOGGER:LEVEL", default=[],
        help="Set log levels for individual loggers. See --help-logging for "
             "complete details.")

    group.add_argument(
        "-L", "--log-file", dest="log_files",
        action="log_files", metavar="LOGGER:FILE", default=[],
        help="Set log the output file for individual loggers. "
             " See --help-logging for complete details.")

    group.add_argument("--help-logging", action="log_help",
                       help=argparse.SUPPRESS)
def addCommandLineArgs ( arg_parser ) : arg_parser . register ( "action" , "log_levels" , LogLevelAction ) arg_parser . register ( "action" , "log_files" , LogFileAction ) arg_parser . register ( "action" , "log_help" , LogHelpAction ) group = arg_parser . add_argument_group ( "Logging options" ) group . add_argument ( "-l" , "--log-level" , dest = "log_levels" , action = "log_levels" , metavar = "LOGGER:LEVEL" , default = [ ] , help = "Set log levels for individual loggers. See --help-logging for " "complete details." ) group . add_argument ( "-L" , "--log-file" , dest = "log_files" , action = "log_files" , metavar = "LOGGER:FILE" , default = [ ] , help = "Set log the output file for individual loggers. " " See --help-logging for complete details." ) group . add_argument ( "--help-logging" , action = "log_help" , help = argparse . SUPPRESS )
Add logging option to an ArgumentParser.
Add logging option to an ArgumentParser .