Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Logger#<<

(untyped msg) -> (untyped | nil)
<<(msg)

Writes the given msg to the log with no formatting; returns the number of characters written, or nil if no log device exists:

Example
logger = Logger.new($stdout)
logger << 'My message.' # => 10

Output:

My message.
See also .new #add #close also in 3.3 · 3.2 · 3.1 · 3.0