def configure_discord_logger(
            self,
            discord_webhook=None,
            discord_recipient=None,
            log_level='ERROR',
            log_format=ReportingFormats.PRETTY_PRINT.value,
            custom_args=''
    ):
        """logger for sending messages to Discord.  Easy way to alert humans of issues

        Note:
            Will try to overwrite minimum log level to enable requested log_level
            Will warn and not attach hipchat logger if missing webhook key
            Learn more about webhooks: https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks

        Args:
            discord_webhook (str): discord room webhook (full URL)
            discord_recipient (`str`:<@int>, optional): user/group to notify
            log_level (str): desired log level for handle https://docs.python.org/3/library/logging.html#logging-levels
            log_format (str): format for logging messages https://docs.python.org/3/library/logging.html#logrecord-attributes
            custom_args (str): special ID to include in messages

        """
        # Override defaults if required #
        discord_webhook = self.config.get_option(
            'LOGGING', 'discord_webhook',
            None, discord_webhook
        )
        discord_recipient = self.config.get_option(
            'LOGGING', 'discord_recipient',
            None, discord_recipient
        )
        log_level = self.config.get_option(
            'LOGGING', 'discord_level',
            None, log_level
        )

        # Actually build discord logging handler #
        discord_obj = DiscordWebhook()
        discord_obj.webhook(discord_webhook)

        # vv TODO vv: Test review #
        if discord_obj.can_query:
            discord_handler = HackyDiscordHandler(
                discord_obj,
                discord_recipient
            )
            self._configure_common(
                'discord_',
                log_level,
                log_format,
                'Discord',
                discord_handler,
                custom_args=custom_args
            )
        else:
            warnings.warn(
                'Unable to execute webhook',
                exceptions.WebhookCreateFailed
            )
def configure_discord_logger ( self , discord_webhook = None , discord_recipient = None , log_level = 'ERROR' , log_format = ReportingFormats . PRETTY_PRINT . value , custom_args = '' ) : discord_webhook = self . config . get_option ( 'LOGGING' , 'discord_webhook' , None , discord_webhook ) discord_recipient = self . config . get_option ( 'LOGGING' , 'discord_recipient' , None , discord_recipient ) log_level = self . config . get_option ( 'LOGGING' , 'discord_level' , None , log_level ) discord_obj = DiscordWebhook ( ) discord_obj . webhook ( discord_webhook ) if discord_obj . can_query : discord_handler = HackyDiscordHandler ( discord_obj , discord_recipient ) self . _configure_common ( 'discord_' , log_level , log_format , 'Discord' , discord_handler , custom_args = custom_args ) else : warnings . warn ( 'Unable to execute webhook' , exceptions . WebhookCreateFailed )
logger for sending messages to Discord.  Easy way to alert humans of issues

        Note:
            Will try to overwrite minimum log level to enable requested log_level
            Will warn and not attach hipchat logger if missing webhook key
            Learn more about webhooks: https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks

        Args:
            discord_webhook (str): discord room webhook (full URL)
            discord_recipient (`str`:<@int>, optional): user/group to notify
            log_level (str): desired log level for handle https://docs.python.org/3/library/logging.html#logging-levels
            log_format (str): format for logging messages https://docs.python.org/3/library/logging.html#logrecord-attributes
            custom_args (str): special ID to include in messages