Class: Bizside::StdoutLogger
- Inherits:
-
Object
- Object
- Bizside::StdoutLogger
- Defined in:
- lib/bizside/stdout_logger.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ StdoutLogger
constructor
A new instance of StdoutLogger.
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 |