<commit_before># Plugin:   logger
# Date:     26th December 2014
# Author:   <NAME>, prologic at shortcircuit dot net dot au


"""Logger Plugin

A plugin to log access to the server.
"""


__version__ = "0.0.1"
__author__ = "<NAME>, prologic at shortcircuit dot net dot au"


from circuits import handler


from ..plugin import BasePlugin


class LoggerPlugin(BasePlugin):
    """Logger Plugin"""

    @handler("response_complete")
    def on_response_complete(self, evt, val):
        res = evt.args[0]
        req = res.req

        logline = "{} - {}{}\n".format(
            req.remote_addr[0], req.selector,
            "?{}".format(req.query) if req.query else ""
        )

        self.logger.info(logline)<commit_msg>Remove trailing \n from logger's logline output<commit_after># Plugin:   logger
# Date:     26th December 2014
# Author:   <NAME>, prologic at shortcircuit dot net dot au


"""Logger Plugin

A plugin to log access to the server.
"""


__version__ = "0.0.1"
__author__ = "<NAME>, prologic at shortcircuit dot net dot au"


from circuits import handler


from ..plugin import BasePlugin


class LoggerPlugin(BasePlugin):
    """Logger Plugin"""

    @handler("response_complete")
    def on_response_complete(self, evt, val):
        res = evt.args[0]
        req = res.req

        logline = "{} - {}{}".format(
            req.remote_addr[0], req.selector,
            "?{}".format(req.query) if req.query else ""
        )

        self.logger.info(logline)
{'fraction_non_alphanumeric': 0.12601078167115903, 'fraction_numerical': 0.014824797843665768, 'mean_word_length': 2.7786259541984735, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2604805', 'n_tokens_mistral': 490, 'n_tokens_neox': 447, 'n_words': 139}