Skip to content

Commit

Permalink
Add debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Dickinson committed Nov 22, 2024
1 parent 3ad3f2a commit eccea83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion supportbot/supportbot/cli/bot_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from supportbot.constants import DEFAULT_CHANNEL_IDS, DEFAULT_NETWORK_NUMBER_PROPERTY_ID


logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.DEBUG)

@click.command()

Expand Down
4 changes: 3 additions & 1 deletion supportbot/supportbot/utils/user_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def network_number(self):

slack_nn_raw = self._profile.get('fields', {}).get(self._network_number_property_id, None)
if slack_nn_raw:
logging.info(f"Found NN text in user's slack profile: {self.user_id}. Validating...")
logging.info(f"Found NN text ({slack_nn_raw}) in user's slack profile: {self.user_id}. Validating...")
slack_nn_matches = re.findall("(\d{3,})", slack_nn_raw['value'])

# slack property nn / install number
Expand All @@ -66,13 +66,15 @@ def network_number(self):
# email nn lookup
logging.info(f"Looking up NN in database by email: {self.email}")
email_nn = self._database_client.email_to_nn(self.email)
logging.debug(f"Heard back from database client")
if email_nn is not None:
logging.info(f"Found NN for email {self.email}: {email_nn}")
return int(email_nn)

# name nn lookup
logging.info(f"Looking up NN in database by name: {self.full_name}")
name_nn = self._database_client.name_to_nn(self.full_name)
logging.debug(f"Heard back from database client")
if name_nn is not None:
logging.info(f"Found NN for name {self.full_name}: {name_nn}")
return int(name_nn)
Expand Down

0 comments on commit eccea83

Please sign in to comment.