def init_logging(log_filename, verbose, quiet):
<EOL>logger = logging.getLogger('<STR_LIT>')<EOL>logger.setLevel(logging.DEBUG)<EOL>if log_filename:<EOL><INDENT>file_handler = logging.FileHandler(log_filename)<EOL>file_handler.setLevel(logging.DEBUG)<EOL>file_handler.setFormatter(<EOL>logging.Formatter(<EOL>fmt="<STR_LIT>"<EOL>))<EOL>logger.addHandler(file_handler)<EOL><DEDENT>console_handler = logging.StreamHandler(sys.stdout)<EOL>stderr_hdl = logging.StreamHandler(sys.stderr)<EOL>fmt_verbose = logging.Formatter(<EOL>fmt="<STR_LIT>",<EOL>datefmt='<STR_LIT>'<EOL>)<EOL>fmt_regular = logging.Formatter(<EOL>"<STR_LIT>", "<STR_LIT>")<EOL>if verbose:<EOL><INDENT>console_handler.setLevel(logging.DEBUG)<EOL>console_handler.setFormatter(fmt_verbose)<EOL>stderr_hdl.setFormatter(fmt_verbose)<EOL><DEDENT>elif quiet:<EOL><INDENT>console_handler.setLevel(logging.WARNING)<EOL>console_handler.setFormatter(fmt_regular)<EOL>stderr_hdl.setFormatter(fmt_regular)<EOL><DEDENT>else:<EOL><INDENT>console_handler.setLevel(logging.INFO)<EOL>console_handler.setFormatter(fmt_regular)<EOL>stderr_hdl.setFormatter(fmt_regular)<EOL><DEDENT>f_err = SingleLevelFilter(logging.ERROR, True)<EOL>f_warn = SingleLevelFilter(logging.WARNING, True)<EOL>f_crit = SingleLevelFilter(logging.CRITICAL, True)<EOL>console_handler.addFilter(f_err)<EOL>console_handler.addFilter(f_warn)<EOL>console_handler.addFilter(f_crit)<EOL>logger.addHandler(console_handler)<EOL>f_info = SingleLevelFilter(logging.INFO, True)<EOL>f_debug = SingleLevelFilter(logging.DEBUG, True)<EOL>stderr_hdl.addFilter(f_info)<EOL>stderr_hdl.addFilter(f_debug)<EOL>logger.addHandler(stderr_hdl)<EOL>
Set up logging with default parameters:
    * default console logging level is INFO
    * ERROR, WARNING and CRITICAL are redirected to stderr

    Args:
        log_filename (str): if set, will write DEBUG log there
        verbose (bool): DEBUG level in console, overrides 'quiet'
        quiet (bool): WARNING level in console