Module: RailsObjectsLogger
- Defined in:
- lib/rails_objects_logger.rb,
lib/rails_objects_logger/version.rb
Constant Summary collapse
- VERSION =
"1.1.0"
Class Method Summary collapse
Class Method Details
.log(level, class_name, message) ⇒ Object
4 5 6 7 8 |
# File 'lib/rails_objects_logger.rb', line 4 def self.log(level, class_name, ) filename, line_number = caller[2].scan(/\/([\w\.]+)\:(\d+)/).flatten extra_info = (filename == (class_name.gsub(/(.)([A-Z])/,'\1_\2').downcase + ".rb")) ? "" : "(from #{filename})" Rails.logger.send(level, "#{level.to_s.capitalize}##{class_name}:#{line_number}#{extra_info}: #{}") end |