(self, debug=False, path=None, window=30)
Initialize NginxParser class.

        Args:
            debug (bool): Log on terminal or not
            path (str): Path of the log file
            window (int): Days old log file to process

        Raises:
            None

        Returns:
            None
Initialize NginxParser class.
Initialize NginxParser class .
def __init__(self, debug=False, path=None, window=30):
        """
        Initialize NginxParser class.

        Args:
            debug (bool): Log on terminal or not
            path (str): Path of the log file
            window (int): Days old log file to process

        Raises:
            None

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

        if path is not None:
            self.path = path
        else:
            self.logger.log(
                "No log path specified, exiting.",
                logtype="error"
            )
            sys.exit(0)

        # Convert window (in days) to seconds
        self.window = int(window) * 24 * 3600  # days * hours * seconds

        # Regex for parsing nginx log file
        self.NGINX_RGX = r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*\[([0-9]' \
                          r'+/[a-zA-Z]+/[0-9]+:[0-9]+:[0-9]+:[0-9]+).*"GET\s(.*)"\s(\d+).*"\s"([^"]+)'

        # Initialize dict for containing parsed data
        self.nginx_dict = dict()
def __init__ ( self , debug = False , path = None , window = 30 ) : # Initialize logger self . logger = ServerLogger ( __name__ , debug = debug ) if path is not None : self . path = path else : self . logger . log ( "No log path specified, exiting." , logtype = "error" ) sys . exit ( 0 ) # Convert window (in days) to seconds self . window = int ( window ) * 24 * 3600 # days * hours * seconds # Regex for parsing nginx log file self . NGINX_RGX = r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*\[([0-9]' r'+/[a-zA-Z]+/[0-9]+:[0-9]+:[0-9]+:[0-9]+).*"GET\s(.*)"\s(\d+).*"\s"([^"]+)' # Initialize dict for containing parsed data self . nginx_dict = dict ( )