lib/rails/labeled_log/logger.rb in rails-labeled_log-0.0.2 vs lib/rails/labeled_log/logger.rb in rails-labeled_log-0.1.0
- old
+ new
@@ -6,18 +6,18 @@
def initialize(*labels)
@labels = labels
end
LabeledLog::LEVELS.each do |level|
- define_method(level) do |message|
- log(level, message)
+ define_method(level) do |message, *additional_labels|
+ log(level, message, additional_labels)
end
end
private
- def log(level, message)
- Rails.logger.tagged(*labels) do
+ def log(level, message, *additional_labels)
+ Rails.logger.tagged(*(labels + additional_labels)) do
Rails.logger.send(level, format_message(message))
end
end
def format_message(message)