def get_logging_options_string(args):
    """ This function extracts the flags and options specified for logging options
        added with add_logging_options. Presumably, this is used in "process-all"
        scripts where we need to pass the logging options to the "process" script.

        Args:
            args (namespace): a namespace with the arguments added by add_logging_options

        Returns:
            string: a string containing all logging flags and options

    """

    args_dict = vars(args)

    # first, pull out the text arguments
    logging_options = ['log_file', 'logging_level', 'file_logging_level',
        'stdout_logging_level', 'stderr_logging_level']

    # create a new dictionary mapping from the flag to the value
    logging_flags_and_vals = {'--{}'.format(o.replace('_', '-')) : args_dict[o] 
        for o in logging_options if len(args_dict[o]) > 0}

    s = ' '.join("{} {}".format(k,v) for k,v in logging_flags_and_vals.items())

    # and check the flags
    if args.log_stdout:
        s = "--log-stdout {}".format(s)

    if args.no_log_stderr:
        s = "--no-log-stderr {}".format(s)

    return s