info(progname = nil, &block) public

Log an INFO message.

message

the message to log; does not need to be a String

progname

in the block form, this is the #progname to use in the the log message. The default can be set with #progname=

&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

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.

Show source
Register or log in to add new notes.