Class: Flex::Rails::Logger
- Inherits:
-
Logger
- Object
- Logger
- Flex::Rails::Logger
- Defined in:
- lib/flex/rails/logger.rb
Instance Attribute Summary collapse
-
#log_to_rails_logger ⇒ Object
Returns the value of attribute log_to_rails_logger.
-
#log_to_stderr ⇒ Object
Returns the value of attribute log_to_stderr.
Instance Method Summary collapse
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #log_to_stdout ⇒ Object
- #log_to_stdout=(val) ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/flex/rails/logger.rb', line 7 def initialize(*) super self.formatter = proc do |severity, datetime, progname, msg| flex_formatted = flex_format(severity, msg) ::Rails.logger.send(severity.downcase.to_sym, flex_formatted) if log_to_rails_logger && ::Rails.logger.respond_to?(severity.downcase.to_sym) flex_formatted if log_to_stderr end @log_to_rails_logger = true @log_to_stderr = false end |
Instance Attribute Details
#log_to_rails_logger ⇒ Object
Returns the value of attribute log_to_rails_logger.
5 6 7 |
# File 'lib/flex/rails/logger.rb', line 5 def log_to_rails_logger @log_to_rails_logger end |
#log_to_stderr ⇒ Object
Returns the value of attribute log_to_stderr.
5 6 7 |
# File 'lib/flex/rails/logger.rb', line 5 def log_to_stderr @log_to_stderr end |
Instance Method Details
#log_to_stdout ⇒ Object
18 19 20 21 |
# File 'lib/flex/rails/logger.rb', line 18 def log_to_stdout Deprecation.warn 'Flex::Configuration.logger.log_to_stdout', 'Flex::Configuration.logger.log_to_stderr' log_to_stderr end |
#log_to_stdout=(val) ⇒ Object
22 23 24 25 |
# File 'lib/flex/rails/logger.rb', line 22 def log_to_stdout=(val) Deprecation.warn 'Flex::Configuration.logger.log_to_stdout=', 'Flex::Configuration.logger.log_to_stderr=' self.log_to_stderr = val end |