def configure_logger(self):

        if hasattr(current, "log"):
            return
            
        settings = current.deployment_settings
        console = settings.get_log_console()
        logfile = settings.get_log_logfile()
        if not console and not logfile:
            # No point to log without output channel
            self.critical = \
            self.error = \
            self.warning = \
            self.info = \
            self.debug = self.ignore
            return

        logger = logging.getLogger(__name__)
        logger.propagate = False
        logger.setLevel(self.log_level)
        logger.handlers = []

        m_format = "%(asctime)s %(caller)s %(levelname)s: %(message)s"
        d_format = "%Y-%m-%d %H:%M:%S"
        formatter = logging.Formatter(m_format, d_format)

        # Set up console handler       
        if console:
            console_handler = logging.StreamHandler(sys.stderr)
            console_handler.setFormatter(formatter)
            console_handler.setLevel(self.log_level)
            logger.addHandler(console_handler)

        # Set up log file handler
        if logfile:
            from logging.handlers import RotatingFileHandler
            MAXBYTES = 1048576
            logfile_handler = RotatingFileHandler(logfile,
                                                  maxBytes = MAXBYTES,
                                                  backupCount = 3)
            logfile_handler.setFormatter(formatter)
            logfile_handler.setLevel(self.log_level)
            logger.addHandler(logfile_handler)
        return

    # -------------------------------------------------------------------------
return html2text
dataset/ETHPy150Open sahana/eden/modules/s3log.py/S3Log.configure_logger--crossover with--dataset/ETHPy150Open frappe/frappe/frappe/email/email_body.py/EMail.set_html_as_text