1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/logger.rb: add Logger#<<(msg) for writing msg without any formatting.

* test/logger/test_logger.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nahi 2003-09-23 14:12:42 +00:00
parent 603e0b1f19
commit 406fd7754e
3 changed files with 45 additions and 1 deletions

View file

@ -185,6 +185,24 @@ class Logger
end
alias log add
# SYNOPSIS
# Logger#<<(msg)
#
# ARGS
# msg Message.
#
# RETURN
# Same as IO#<<. If logdev is not given, returns nil.
#
# DESCRIPTION
# Dump given message to log device without any formatting.
#
def <<(msg)
unless @logdev.nil?
@logdev.write(msg)
end
end
# SYNOPSIS
# Logger#debug(progname = nil) { ... } = nil
# Logger#info(progname = nil) { ... } = nil