# Path: txircd/modbase.py
# class Module(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
# 
# Path: txircd/utils.py
# class CaseInsensitiveDictionary(MutableMapping):
#     def __init__(self):
#         self._data = {}
# 
#     def __repr__(self):
#         return repr(self._data)
# 
#     def __delitem__(self, key):
#         try:
#             del self._data[irc_lower(key)]
#         except KeyError:
#             raise KeyError(key)
# 
#     def __getitem__(self, key):
#         try:
#             return self._data[irc_lower(key)]
#         except KeyError:
#             raise KeyError(key)
# 
#     def __iter__(self):
#         return iter(self._data)
# 
#     def __len__(self):
#         return len(self._data)
# 
#     def __setitem__(self, key, value):
#         self._data[irc_lower(key)] = value
# 
# def now():
#     return datetime.datetime.utcnow().replace(microsecond=0)


from twisted.python.logfile import DailyLogFile
from txircd.modbase import Module
from txircd.utils import CaseInsensitiveDictionary, now
        try:
            channel.name
        except AttributeError:
            return
        self.writeLog(channel, "! {} has set modes {}".format(source, modeLine))
    
    def onDestroy(self, channel):
        if channel.name in self.logfiles:
            self.logfiles[channel.name].close()
            del self.logfiles[channel.name]
    
    def closeAllFiles(self):
        for logFile in self.logfiles.itervalues():
            logFile.close()
        self.logfiles.clear()

class Spawner(object):
    def __init__(self, ircd):
        self.ircd = ircd
        self.logger = None
    
    def spawn(self):
        self.logger = Logger().hook(self.ircd)
        return {
            "actions": {
                "join": self.logger.logJoin,
                "nick": self.logger.logNick,
                "quit": self.logger.logQuit,
                "topic": self.logger.logTopic,
                "mode": self.logger.logMode,

# Path: txircd/modbase.py
# class Module(object):
#     def hook(self, base):
#         self.ircd = base
#         return self
# 
# Path: txircd/utils.py
# class CaseInsensitiveDictionary(MutableMapping):
#     def __init__(self):
#         self._data = {}
# 
#     def __repr__(self):
#         return repr(self._data)
# 
#     def __delitem__(self, key):
#         try:
#             del self._data[irc_lower(key)]
#         except KeyError:
#             raise KeyError(key)
# 
#     def __getitem__(self, key):
#         try:
#             return self._data[irc_lower(key)]
#         except KeyError:
#             raise KeyError(key)
# 
#     def __iter__(self):
#         return iter(self._data)
# 
#     def __len__(self):
#         return len(self._data)
# 
#     def __setitem__(self, key, value):
#         self._data[irc_lower(key)] = value
# 
# def now():
#     return datetime.datetime.utcnow().replace(microsecond=0)


# Path: txircd/modules/channellog.py
from twisted.python.logfile import DailyLogFile
from txircd.modbase import Module
from txircd.utils import CaseInsensitiveDictionary, now

        try:
            channel.name
        except AttributeError:
            return
        self.writeLog(channel, "! {} has set modes {}".format(source, modeLine))
    
    def onDestroy(self, channel):
        if channel.name in self.logfiles:
            self.logfiles[channel.name].close()
            del self.logfiles[channel.name]
    
    def closeAllFiles(self):
        for logFile in self.logfiles.itervalues():
            logFile.close()
        self.logfiles.clear()

class Spawner(object):
    def __init__(self, ircd):
        self.ircd = ircd
        self.logger = None
    
    def spawn(self):
        self.logger = Logger().hook(self.ircd)
        return {
            "actions": {
                "join": self.logger.logJoin,
                "nick": self.logger.logNick,
                "quit": self.logger.logQuit,
                "topic": self.logger.logTopic,
                "mode": self.logger.logMode,

                "commandextra": self.logger.logMsg,