Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adjust logging behaviour #6

Merged
merged 2 commits into from

2 participants

@glenngillen

Looks like ActiveSupport::Concerns already have access to a logger, and by default logging a user's email address in plain-text is unlikely to get past our security guys.

@garygreyling garygreyling merged commit 276513b into mpowered:master
@garygreyling
Owner

Thanks Glenn :) CMS 1.0.2 is out :)

@garygreyling
Owner

Hi Glenn, just so that you're aware: I've reverted the use of AR's logger. I overlooked the fact that the use of AR's #logger meant the gem would no longer log to log/cm_subscriber.log. I have, however, retained your changes to only logging emails as a debug message. Thanks for your input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/campaign_monitor_subscriber/subscription_hooks.rb
View
7 lib/campaign_monitor_subscriber/subscription_hooks.rb
@@ -6,11 +6,8 @@ module SubscriptionHooks
extend ActiveSupport::Concern
included do
- require 'logger'
- @@log = Logger.new('log/cm_subscriber.log')
-
after_create do |record|
- @@log.info "\n* Adding '#{record.cms_email}' to CM"
+ logger.debug "\n* Adding '#{record.cms_email}' to CM"
begin
CreateSend::Subscriber.add(
@@ -27,7 +24,7 @@ module SubscriptionHooks
after_destroy do |record|
- @@log.info "\n* Removing '#{record.cms_email}' from CM"
+ logger.debug "\n* Removing '#{record.cms_email}' from CM"
begin
s = CreateSend::Subscriber.new(
Something went wrong with that request. Please try again.