PyFunceble/logs.py
def whois(self, record):
        """
        Logs the WHOIS record if needed.

        :param record: The record to log.
        :type record: str
        """

        if PyFunceble.CONFIGURATION["debug"] and PyFunceble.CONFIGURATION["logs"]:
            # The debug and the logs subsystem are activated.

            if PyFunceble.INTERN["referer"]:
                referer = PyFunceble.INTERN["referer"]
            else:
                referer = None

            to_write = {
                self.current_time: {
                    "domain": PyFunceble.INTERN["to_test"],
                    "record": record,
                    "referer": referer,
                }
            }

            if self.output:
                output = self.output
            else:
                output = PyFunceble.OUTPUT_DIRECTORY
                output += PyFunceble.OUTPUTS["parent_directory"]
                output += PyFunceble.OUTPUTS["logs"]["directories"]["parent"]
                output += PyFunceble.OUTPUTS["logs"]["filenames"]["whois"]

            current_content = self._get_content(output)
            current_content.update(to_write)

            self._write_content(current_content, output)
def whois(self, record):
        if PyFunceble.CONFIGURATION["debug"] and PyFunceble.CONFIGURATION["logs"]:
            # The debug and the logs subsystem are activated.

            if PyFunceble.INTERN["referer"]:
                referer = PyFunceble.INTERN["referer"]
            else:
                referer = None

            to_write = {
                self.current_time: {
                    "domain": PyFunceble.INTERN["to_test"],
                    "record": record,
                    "referer": referer,
                }
            }

            if self.output:
                output = self.output
            else:
                output = PyFunceble.OUTPUT_DIRECTORY
                output += PyFunceble.OUTPUTS["parent_directory"]
                output += PyFunceble.OUTPUTS["logs"]["directories"]["parent"]
                output += PyFunceble.OUTPUTS["logs"]["filenames"]["whois"]

            current_content = self._get_content(output)
            current_content.update(to_write)

            self._write_content(current_content, output)
def whois ( self , record ) : if PyFunceble . CONFIGURATION [ "debug" ] and PyFunceble . CONFIGURATION [ "logs" ] : # The debug and the logs subsystem are activated. if PyFunceble . INTERN [ "referer" ] : referer = PyFunceble . INTERN [ "referer" ] else : referer = None to_write = { self . current_time : { "domain" : PyFunceble . INTERN [ "to_test" ] , "record" : record , "referer" : referer , } } if self . output : output = self . output else : output = PyFunceble . OUTPUT_DIRECTORY output += PyFunceble . OUTPUTS [ "parent_directory" ] output += PyFunceble . OUTPUTS [ "logs" ] [ "directories" ] [ "parent" ] output += PyFunceble . OUTPUTS [ "logs" ] [ "filenames" ] [ "whois" ] current_content = self . _get_content ( output ) current_content . update ( to_write ) self . _write_content ( current_content , output )
Logs the WHOIS record if needed.

        :param record: The record to log.
        :type record: str
Logs the WHOIS record if needed .