GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 3670e782 authored by Cecylia Bocovich's avatar Cecylia Bocovich

Change levels at which service messages are logged

A lot of these are debug messages and don't need to be logged by
default.
parent b8d228ad
......@@ -57,13 +57,13 @@ class Sendmail(object):
:param message (string): Success details from the server.
"""
log.info("Email sent successfully.")
log.debug("Email sent successfully.")
def sendmail_errback(self, error):
"""
Errback if we don't/can't send the message.
"""
log.debug("Could not send email.")
log.warn("Could not send email.")
raise error
def sendmail(self, email_addr, subject, body):
......@@ -198,7 +198,7 @@ class Sendmail(object):
subject_msg = strings._("help_subject")
elif command == "links":
log.info("Getting links for {} {}.".format(platform, language))
log.debug("Getting links for {} {}.".format(platform, language))
links = yield self.conn.get_links(
platform=platform, language=language, status="ACTIVE"
)
......@@ -208,12 +208,12 @@ class Sendmail(object):
body_msg = self.build_body_message(link_msg, platform, file)
subject_msg = strings._("links_subject")
else:
log.info("Invalid gettor command {}.".format(command))
log.warn("Invalid gettor command {}.".format(command))
yield self.conn.remove_request(
id=id, service="email", date=date
)
log.info("Sending {} message.".format(request[1]))
log.debug("Sending {} message.".format(request[1]))
yield self.sendmail(
email_addr=id,
......@@ -235,7 +235,7 @@ class Sendmail(object):
yield self.conn.remove_request(
id=id, service="email", date=date
)
log.info("Error sending email: {}.".format(e))
log.error("Error sending email: {}.".format(e))
except Exception as e:
log.error("Error sending email: {}.".format(e))
......@@ -59,14 +59,14 @@ class Twitterdm(object):
:param message (string): Success details from the server.
"""
log.info("Message sent successfully.")
log.debug("Message sent successfully.")
def twitter_errback(self, error):
"""
Errback if we don't/can't send the message.
"""
log.debug("Could not send message.")
log.warn("Could not send message.")
raise RuntimeError("{}".format(error))
......@@ -131,7 +131,7 @@ class Twitterdm(object):
if help_requests:
strings.load_strings("en")
try:
log.info("Got new help request.")
log.debug("Got new help request.")
for request in help_requests:
ids = json.loads("{}".format(request[0].replace("'", '"')))
......@@ -140,7 +140,7 @@ class Twitterdm(object):
date = request[5]
hid = hashlib.sha256(twitter_id.encode('utf-8'))
log.info(
log.debug(
"Sending help message to {}.".format(
hid.hexdigest()
)
......@@ -166,11 +166,11 @@ class Twitterdm(object):
)
except RuntimeError as e:
log.info("Error sending twitter message: {}.".format(e))
log.error("Error sending twitter message: {}.".format(e))
elif link_requests:
try:
log.info("Got new links request.")
log.debug("Got new links request.")
for request in link_requests:
ids = json.loads("{}".format(request[0].replace("'", '"')))
......@@ -188,7 +188,7 @@ class Twitterdm(object):
strings.load_strings(language)
locale = locales[language]['locale']
log.info("Getting links for {}.".format(platform))
log.debug("Getting links for {}.".format(platform))
links = yield self.conn.get_links(
platform=platform, language=locale, status="ACTIVE"
)
......@@ -225,7 +225,7 @@ class Twitterdm(object):
body_msg += trings._("links_body_ending")
hid = hashlib.sha256(twitter_id.encode('utf-8'))
log.info(
log.debug(
"Sending links to {}.".format(
hid.hexdigest()
)
......@@ -247,6 +247,6 @@ class Twitterdm(object):
)
except RuntimeError as e:
log.info("Error sending message: {}.".format(e))
log.error("Error sending message: {}.".format(e))
else:
log.debug("No pending twitter requests. Keep waiting.")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment