Class: Bizside::StdoutLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/bizside/stdout_logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ StdoutLogger

Returns a new instance of StdoutLogger.



4
5
6
7
8
9
10
11
12
13
# File 'lib/bizside/stdout_logger.rb', line 4

def initialize(app)
  @app = app
  console = ActiveSupport::Logger.new(STDOUT)
  console.formatter = Rails.logger.formatter
  console.level = Rails.logger.level

  unless ActiveSupport::Logger.logger_outputs_to?(Rails.logger, STDOUT)
    Rails.logger.extend(ActiveSupport::Logger.broadcast(console))
  end
end

Instance Method Details

#call(env) ⇒ Object



15
16
17
# File 'lib/bizside/stdout_logger.rb', line 15

def call(env)
  return @app.call(env)
end