Permalink
Browse files

Fix other Twisted logging

  • Loading branch information...
ElementalAlchemist committed Dec 6, 2017
1 parent bf0f1bf commit e88f3ef2517e17f4498e594c4ad168d29fb267d3
View
@@ -415,7 +415,7 @@ def reloadModule(self, moduleName: str) -> Optional[DeferredList]:
return deferList
def _logReloadModuleError(self, failure: "Failure", moduleName: str) -> None:
self.log.critical("Module {moduleName} couldn't be reloaded! The server may be left in an unstable state; consider restarting. Error details: {failure.getErrorMessage()}", moduleName=moduleName, failure=failure)
self.log.critical("Module {moduleName} couldn't be reloaded! The server may be left in an unstable state; consider restarting. Error details: {failureError()}", moduleName=moduleName, failureError=failure.getErrorMessage)
def verifyConfig(self, config: Dict[str, Any]) -> None:
# IRCd
@@ -50,7 +50,7 @@ def checkUserMatch(self, user: "IRCUser", mask: str, data: Optional[Dict[Any, An
return False
def killUser(self, user: "IRCUser", reason: str) -> None:
self.ircd.log.info("Matched user {user.uuid} ({user.ident}@{user.host()}) against a g:line: {reason}", user=user, reason=reason)
self.ircd.log.info("Matched user {user.uuid} ({user.ident}@{userHost()}) against a g:line: {reason}", user=user, userHost=user.host, reason=reason)
user.sendMessage(irc.ERR_YOUREBANNEDCREEP, self.ircd.config.get("client_ban_msg", "You're banned! Email abuse@example.com for assistance."))
user.disconnect("G:Lined: {}".format(reason))
@@ -47,7 +47,7 @@ def checkUserMatch(self, user: "IRCUser", mask: str, data: Optional[Dict[Any, An
return False
def killUser(self, user: "IRCUser", reason: str) -> None:
self.ircd.log.info("Matched user {user.uuid} ({user.ident}@{user.host()}) against a k:line: {reason}", user=user, reason=reason)
self.ircd.log.info("Matched user {user.uuid} ({user.ident}@{userHost()}) against a k:line: {reason}", user=user, userHost=user.host, reason=reason)
user.sendMessage(irc.ERR_YOUREBANNEDCREEP, self.ircd.config.get("client_ban_msg", "You're banned! Email abuse@example.com for assistance."))
user.disconnect("K:Lined: {}".format(reason))
@@ -56,7 +56,7 @@ def checkUserMatch(self, user: "IRCUser", mask: str, data: Optional[Dict[Any, An
def checkLines(self, user: "IRCUser") -> None:
if self.matchUser(user) is not None:
user.cache["shunned"] = True
self.ircd.log.info("Matched user {user.uuid} ({user.ident}@{user.host()}) against a shun", user=user)
self.ircd.log.info("Matched user {user.uuid} ({user.ident}@{userHost()}) against a shun", user=user, userHost=user.host)
elif "shunned" in user.cache:
del user.cache["shunned"]
@@ -44,6 +44,6 @@ def runConnections(self) -> None:
if not d:
self.ircd.log.warn("Failed to autoconnect server {serverName}: probably broken config", serverName=serverName)
else:
d.addErrback(lambda result: self.ircd.log.error("Failed to autoconnect server {serverName}: {err.getErrorMessage()}", serverName=serverName, err=result))
d.addErrback(lambda result: self.ircd.log.error("Failed to autoconnect server {serverName}: {errMsg()}", serverName=serverName, errMsg=result.getErrorMessage))
autoconnect = ServerAutoconnect()
View
@@ -342,7 +342,7 @@ def register(self, holdName: str) -> None:
return
self._registerHolds.remove("registercheck")
self.ircd.userNicks[self.nick] = self
self.ircd.log.debug("Registering user {user.uuid} ({user.hostmask()})", user=self)
self.ircd.log.debug("Registering user {user.uuid} ({userHostmask()})", user=self, userHostmask=self.hostmask)
versionWithName = "txircd-{}".format(version)
self.sendMessage(irc.RPL_WELCOME, "Welcome to the {} Internet Relay Chat Network {}".format(self.ircd.config["network_name"], self.hostmask()))
self.sendMessage(irc.RPL_YOURHOST, "Your host is {}, running version {}".format(self.ircd.name, versionWithName))
@@ -879,7 +879,7 @@ def register(self, holdName: str, fromRemote: bool = False) -> None:
return
if holdName not in self._registerHolds:
return
self.ircd.log.debug("Registered remote user {user.uuid} ({user.hostmask()})", user=self)
self.ircd.log.debug("Registered remote user {user.uuid} ({userHostmask()})", user=self, userHostmask=self.hostmask)
self._registerHolds.remove(holdName)
if not self._registerHolds:
self.ircd.runActionStandard("remoteregister", self, users=[self])
@@ -986,7 +986,7 @@ def __init__(self, ircd, nick, ident, host, ip, gecos):
self.nick = nick
self.ident = ident
self.gecos = gecos
self.ircd.log.debug("Created new local user {user.uuid} ({user.hostmask()})", user=self)
self.ircd.log.debug("Created new local user {user.uuid} ({userHostmask()})", user=self, userHostmask=self.hostmask)
self.ircd.runActionStandard("localregister", self, users=[self])
self.ircd.userNicks[self.nick] = self
@@ -1016,7 +1016,7 @@ def disconnect(self, reason: str) -> None:
userSendList.extend(channel.users.keys())
userSendList = [u for u in set(userSendList) if u.uuid[:3] == self.ircd.serverID]
userSendList.remove(self)
self.ircd.log.debug("Removing local user {user.uuid} ({user.hostmask()}): {reason}", user=self, reason=reason)
self.ircd.log.debug("Removing local user {user.uuid} ({userHostmask()}): {reason}", user=self, userHostmask=self.hostmask, reason=reason)
self.ircd.runActionProcessing("quitmessage", userSendList, self, reason, None, users=userSendList)
self.ircd.runActionStandard("localquit", self, reason, users=[self])

0 comments on commit e88f3ef

Please sign in to comment.