Class | Logger |
In: |
lib/inactive_support/clean_logger.rb
|
Parent: | Object |
Extensions to the built in Ruby logger.
If you want to use the default log formatter as defined in the Ruby core, then you will need to set the formatter for the logger as in:
logger.formatter = Formatter.new
You can then specify the datetime format, for example:
logger.datetime_format = "%Y-%m-%d"
Note: This logger is deprecated in favor of ActiveSupport::BufferedLogger
datetime_format= | -> | old_datetime_format= |
datetime_format | -> | old_datetime_format |
formatter | -> | old_formatter |
format_message | -> | old_format_message |
format_datetime | -> | old_format_datetime |
msg2str | -> | old_msg2str |
Logging date-time format (string passed to strftime). Ignored if the formatter does not respond to datetime_format=.
# File lib/inactive_support/clean_logger.rb, line 38 def datetime_format=(datetime_format) formatter.datetime_format = datetime_format if formatter.respond_to?(:datetime_format=) end
Get the current formatter. The default formatter is a SimpleFormatter which only displays the log message
# File lib/inactive_support/clean_logger.rb, line 52 def formatter @formatter ||= SimpleFormatter.new end