Skip to content

Commit

Permalink
Merge pull request #2 from groupme/hash-recipient
Browse files Browse the repository at this point in the history
hash the recipient's number in the log
  • Loading branch information
whereandy committed May 21, 2014
2 parents dba7d48 + fe4e22f commit e0b260f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/em-kannel/log_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def message
parts = [
"CODE=#{@response.status}",
"FROM=#{@message.from}",
"TO=#{@message.to}",
"TO=#{Digest::MD5.hexdigest(@message.to.delete(" "))}",
"BODY=#{@message.body[0..100]}",
"RESPONSE=#{@response.body}",
"TIME=#{@response.duration}"
Expand Down
5 changes: 3 additions & 2 deletions spec/em-kannel/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
to_return(:status => 202, :body => uuid)

EM::Kannel.logger.should_receive(:info).with(
/CODE=202 FROM=\+12125551212 TO=\+17185551212 BODY=testing RESPONSE=#{uuid} TIME=[0-9]/
/CODE=202 FROM=\+12125551212 TO=78c929715ef3d957ad835697ced0e295 BODY=testing RESPONSE=#{uuid} TIME=[0-9]/

)

EM.run_block {
Expand All @@ -73,7 +74,7 @@
to_return(:status => 404, :body => "API not available")

EM::Kannel.logger.should_receive(:info).with(
/CODE=404 FROM=\+12125551212 TO=\+17185551212 BODY=testing RESPONSE=API not available TIME=[0-9]/
/CODE=404 FROM=\+12125551212 TO=78c929715ef3d957ad835697ced0e295 BODY=testing RESPONSE=API not available TIME=[0-9]/
)

EM.run_block {
Expand Down

0 comments on commit e0b260f

Please sign in to comment.