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:
parent
7333febb23
commit
0373afba17
1 changed files with 6 additions and 8 deletions
|
@ -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 }
|
||||
|
|
Loading…
Reference in a new issue