Skip to content

Commit

Permalink
use stdlib logger for FEDERATION_LOGGER, closes #5657
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed May 4, 2015
1 parent 2570d88 commit 7060840
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/federation_logger.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#custom_logger.rb

class ActiveSupport::BufferedLogger
def formatter=(formatter)
@log.formatter = formatter
end
end

class Formatter
COLORS = {
'FG' => {
Expand Down Expand Up @@ -104,14 +96,11 @@ def pretty_message msg

end

class FederationLogger < ActiveSupport::BufferedLogger
end

if Rails.env.match(/integration/)
puts "using federation logger"
logfile = File.open(Rails.root.join("log", "federation_logger.log"), 'a') #create log file
logfile.sync = true #automatically flushes data to file
FEDERATION_LOGGER = FederationLogger.new(logfile) #constant accessible anywhere
FEDERATION_LOGGER = Logger.new(logfile) #constant accessible anywhere
FEDERATION_LOGGER.formatter = Formatter.new
else
FEDERATION_LOGGER = Rails.logger
Expand Down

0 comments on commit 7060840

Please sign in to comment.