# Path: irisett/log.py
# def configure_logging(logtype: str, logfilename: Optional[str]=None, debug_logging: bool=False,
#                       rotate_length: int=1000000, max_rotated_files: int=250) -> None:
# def msg(logmsg: str, section: Optional[str]=None) -> None:
# def debug(logmsg: str, section: Optional[str]=None) -> None:
#     def log_msg(self, logmsg: str) -> None:
#     def log_debug(self, logmsg: str) -> None:
# class LoggingMixin:


from typing import Any, Optional, Dict, Iterable
from irisett import (
    log
)
import aiohttp
import json
    out_data = json.dumps(in_data)
    try:
        async with aiohttp.ClientSession() as session:
            async with session.post(url, data=out_data, timeout=10) as resp:
                if resp.status != 200:
                    log.msg('Error sending http notification: http status %s' % (str(resp.status)),
                            'NOTIFICATION')
    except aiohttp.ClientError as e:
        log.msg('Error sending http notification: %s' % (str(e)), 'NOTIFICATIONS')


async def send_alert_notification(settings: Dict[str, Any], email_recipients: Iterable[str],
                                  sms_recipients: Iterable[str], tmpl_args: Dict[str, Any]):
    data = {
        'email_recipients': email_recipients,
        'sms_recipients': sms_recipients,
        'data': tmpl_args,
    }

    await send_http_notification(settings['url'], data)


def parse_settings(config: Any) -> Optional[Dict[str, Any]]:
    ret = {
        'url': config.get('http-url'),
    }  # type: Any
    if not ret['url']:
        log.debug('HTTP settings missing, no slack notifications will be sent', 'NOTIFICATIONS')
        ret = None
    else:

# Path: irisett/log.py
# def configure_logging(logtype: str, logfilename: Optional[str]=None, debug_logging: bool=False,
#                       rotate_length: int=1000000, max_rotated_files: int=250) -> None:
# def msg(logmsg: str, section: Optional[str]=None) -> None:
# def debug(logmsg: str, section: Optional[str]=None) -> None:
#     def log_msg(self, logmsg: str) -> None:
#     def log_debug(self, logmsg: str) -> None:
# class LoggingMixin:


# Path: irisett/notify/http.py
from typing import Any, Optional, Dict, Iterable
from irisett import (
    log
)
import aiohttp
import json

    out_data = json.dumps(in_data)
    try:
        async with aiohttp.ClientSession() as session:
            async with session.post(url, data=out_data, timeout=10) as resp:
                if resp.status != 200:
                    log.msg('Error sending http notification: http status %s' % (str(resp.status)),
                            'NOTIFICATION')
    except aiohttp.ClientError as e:
        log.msg('Error sending http notification: %s' % (str(e)), 'NOTIFICATIONS')


async def send_alert_notification(settings: Dict[str, Any], email_recipients: Iterable[str],
                                  sms_recipients: Iterable[str], tmpl_args: Dict[str, Any]):
    data = {
        'email_recipients': email_recipients,
        'sms_recipients': sms_recipients,
        'data': tmpl_args,
    }

    await send_http_notification(settings['url'], data)


def parse_settings(config: Any) -> Optional[Dict[str, Any]]:
    ret = {
        'url': config.get('http-url'),
    }  # type: Any
    if not ret['url']:
        log.debug('HTTP settings missing, no slack notifications will be sent', 'NOTIFICATIONS')
        ret = None
    else:

        log.debug('Valid HTTP notification settings found', 'NOTIFICATIONS')