1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Complete all the standard severity levels

This commit is contained in:
David Heinemeier Hansson 2015-07-07 22:45:12 +02:00
parent 7333febb23
commit 0373afba17

View file

@ -9,19 +9,17 @@ module ActionCable
@tags = tags.flatten
end
def info(message)
log :info, message
end
def error(message)
log :error, message
end
def add_tags(*tags)
@tags += tags.flatten
@tags = @tags.uniq
end
%i( debug info warn error fatal unknown ).each do |severity|
define_method(severity) do |message|
log severity, message
end
end
protected
def log(type, message)
@logger.tagged(*@tags) { @logger.send type, message }