forked from wingrunr21/griddler-mandrill
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Developers may include debug messages in their application logs (#1)
* Developers may include debug messages in their application logs There were some breaking changes with how the griddler gem was packaged. This caused rake to fail until we downloaded the photos and updated the spec helper. * Use Ruby 2.0 compliant syntax for defining protected methods
- Loading branch information
Showing
6 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
require 'griddler' | ||
require 'griddler/mandrill/version' | ||
require 'griddler/mandrill/adapter' | ||
require 'griddler/mandrill/logging' | ||
|
||
Griddler.adapter_registry.register(:mandrill, Griddler::Mandrill::Adapter) | ||
Griddler.adapter_registry.register(:mandrill, Griddler::Mandrill::Adapter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Griddler | ||
module Mandrill | ||
module Logging | ||
# The default logger discards all message; as we do not want | ||
# to start clogging up existing users logs. | ||
def self.logger | ||
@logger ||= NullLogger.new(STDOUT) | ||
end | ||
|
||
# Set your application's logger | ||
# @example In a Rails initializer: | ||
# Griddler::Mandrill::Logging.logger = Rails.logger | ||
# @example In Rails while logging a different level than the default logger | ||
# Griddler::Mandrill::Logging.logger = ActiveSupport::Logger.new(Rails.logger, level: :debug) | ||
def self.logger=(logger) | ||
@logger = logger | ||
end | ||
|
||
# A logger which discards messages | ||
class NullLogger < Logger | ||
# Overload the Logger#add method as this is where the #info/#warn/#error methods | ||
# send their messags to the logging subsystem. | ||
def add(*_arguments) | ||
end | ||
end | ||
end | ||
end | ||
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters