Skip to content

Add country code to log output #5

Description

@mallorydxw

At the moment we log "About to send SMS from %s to %s" before every SMS gets sent.

In order to make it easier for sysadmins writing scripts to check for suspicious things, we should add " [GB]" to the end of that which represents the country code of the recipient number.

There are PHP ports of Google's libphonenumber. That's probably our best bet.

Here's what I'm thinking:

  1. Add an optional constant for the "local" region (maybe TWOFA_LOCAL_REGION)
  2. Before logging, parse the number in the local context and get the 2-letter country code from the region code of the parsed number

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions