End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Logger#info
info(message)
info(progname, &block)
lib/logger.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/logger.rb, line 528
def info(progname = nil, &block)
add(INFO, nil, progname, &block)
end
Log an INFO message.
message-
The message to log; does not need to be a
String. progname-
In the block form, this is the
prognameto use in the log message. The default can be set withprogname=. block-
Evaluates to the message to log. This is not evaluated unless the logger’s level is sufficient to log the message. This allows you to create potentially expensive logging messages that are only called when the logger is configured to show them.
Examples
Example
logger.info("MainApp") { "Received connection from #{ip}" } # ... logger.info "Waiting for input from user" # ... logger.info { "User typed #{input}" }
You’ll probably stick to the second form above, unless you want to provide a program name (which you can do with progname= as well).
Return
See add.