(self,
                 debug=False,
                 log_type=None,
                 log_file=None,
                 window=30,
                 ip_list=None,
                 status_code=None)
Initialize ServerLog Monitor Engine.

        Args:
            debug (bool): Log on terminal or not
            type (str): Type of log file (Apache, Nginx)
            log_file (str): Path of the log file
            window (int): Days old log to process
            ip_list (str): List of IPs to filter
            status_code (str): List of status code to filter

        Raises:
            None

        Returns:
            None
Initialize ServerLog Monitor Engine.
Initialize ServerLog Monitor Engine .
def __init__(self,
                 debug=False,
                 log_type=None,
                 log_file=None,
                 window=30,
                 ip_list=None,
                 status_code=None):
        """
        Initialize ServerLog Monitor Engine.

        Args:
            debug (bool): Log on terminal or not
            type (str): Type of log file (Apache, Nginx)
            log_file (str): Path of the log file
            window (int): Days old log to process
            ip_list (str): List of IPs to filter
            status_code (str): List of status code to filter

        Raises:
            None

        Returns:
            None
        """
        # Initialize logger
        self.logger = ServerLogger(
                __name__,
                debug=debug
        )

        # Check running as root or not
        if not utils.check_root():
            self.logger.log(
                "Please start as root, exiting.",
                logtype="error"
            )
            sys.exit(0)

        if ip_list:
            ip_list = utils.get_list(ip_list)

        if status_code:
            status_code = utils.get_list(status_code)

        # Check the variables
        if log_file == "":
            log_file = None
        else:
            log_file = log_file.strip(" ")

        if log_type == "":
            log_type = None
        else:
            log_type = log_type.strip(" ")

        if window == "":
            window = 30
        else:
            window = int(window)

        # Create Engine
        self.engine_obj = Engine(
                        debug=debug,
                        log_type=log_type,
                        log_file=log_file,
                        window=window,
                        ip_list=ip_list,
                        status_code=status_code
                    )
def __init__ ( self , debug = False , log_type = None , log_file = None , window = 30 , ip_list = None , status_code = None ) : # Initialize logger self . logger = ServerLogger ( __name__ , debug = debug ) # Check running as root or not if not utils . check_root ( ) : self . logger . log ( "Please start as root, exiting." , logtype = "error" ) sys . exit ( 0 ) if ip_list : ip_list = utils . get_list ( ip_list ) if status_code : status_code = utils . get_list ( status_code ) # Check the variables if log_file == "" : log_file = None else : log_file = log_file . strip ( " " ) if log_type == "" : log_type = None else : log_type = log_type . strip ( " " ) if window == "" : window = 30 else : window = int ( window ) # Create Engine self . engine_obj = Engine ( debug = debug , log_type = log_type , log_file = log_file , window = window , ip_list = ip_list , status_code = status_code )