def __send_notification(self, message, title, title_link='', color='good',
                            fields='', log_level=LogLv.INFO):
        """Send a message to a channel.
        Args:
            title: A message title.
            title: A link of the message title.
            message: The message body.
            color: Can either be one of 'good', 'warning', 'danger',
                   or any hex color code.

        Returns:
            response: A Response of Slack API.

        Raises:
            Exception:
        """
        if log_level < self.log_level:
            return None

        payload = self.__build_payload(message, title, title_link, color, fields)

        try:
            response = requests.post(self.web_hook_url,
                                     data=json.dumps(payload), timeout=3, allow_redirects=False)

        except Exception:
            raise Exception(traceback.format_exc())

        else:
            if response.status_code == 200:
                return response

            else:
                raise Exception('POST failed.')
dataset/ETHPy150Open iktakahiro/slackpy/slackpy/slackpy.py/SlackLogger.__send_notification/original