# Path: irisett/errors.py
# class IrisettError(Exception):
# class InvalidArguments(IrisettError):
#     def __str__(self) -> str:


from typing import Optional, Any, cast
from irisett import errors
import os
import os.path
import logging
import logging.handlers
"""Basic logging functionality.

Supports logging to stdout, syslog and file.
"""




# Yes yes, globals are ugly.
logger = None


def configure_logging(logtype: str, logfilename: Optional[str]=None, debug_logging: bool=False,
                      rotate_length: int=1000000, max_rotated_files: int=250) -> None:
    global logger
    level = logging.INFO
    if debug_logging:
        level = logging.DEBUG
    if logtype not in ['stdout', 'syslog', 'file']:

# Path: irisett/errors.py
# class IrisettError(Exception):
# class InvalidArguments(IrisettError):
#     def __str__(self) -> str:


# Path: irisett/log.py
from typing import Optional, Any, cast
from irisett import errors
import os
import os.path
import logging
import logging.handlers

"""Basic logging functionality.

Supports logging to stdout, syslog and file.
"""




# Yes yes, globals are ugly.
logger = None


def configure_logging(logtype: str, logfilename: Optional[str]=None, debug_logging: bool=False,
                      rotate_length: int=1000000, max_rotated_files: int=250) -> None:
    global logger
    level = logging.INFO
    if debug_logging:
        level = logging.DEBUG
    if logtype not in ['stdout', 'syslog', 'file']:

        raise errors.IrisettError('invalid logtype name %s' % logtype)