summaryrefslogtreecommitdiff
path: root/lib/logger.rb
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-23 14:12:42 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-23 14:12:42 +0000
commit406fd7754e804312d457fb09e0ded92afe0c0d54 (patch)
tree9f9047c7f6c90730fa200165c4c548bea323161c /lib/logger.rb
parent603e0b1f19928422594c6a2d934663c01214f42f (diff)
* 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
Diffstat (limited to 'lib/logger.rb')
-rw-r--r--lib/logger.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/logger.rb b/lib/logger.rb
index 7e8134e..04a106b 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -186,6 +186,24 @@ class Logger
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
# Logger#warn(progname = nil) { ... } = nil