instance method
add
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v3.2.22.5Signature
add(severity, message = nil, progname = nil, &block)
No documentation comment.
Parameters
-
severityreq -
messageopt = nil -
prognameopt = nil -
blockblock
Source
# File activesupport/lib/active_support/buffered_logger.rb, line 60
def add(severity, message = nil, progname = nil, &block)
return if @level > severity
message = (message || (block && block.call) || progname).to_s
# If a newline is necessary then create a new message ending with a newline.
# Ensures that the original message is not mutated.
message = "#{message}\n" unless message[-1] == ?\n
buffer << message
auto_flush
message
end
Defined in activesupport/lib/active_support/buffered_logger.rb line 60
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::BufferedLogger