diff options
author | Kouhei Sutou <kou@clear-code.com> | 2010-07-17 15:36:40 +0900 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-07-19 14:55:58 -0700 |
commit | a6e95ba55401ddcaf9ef867a080b30c2d07c56ac (patch) | |
tree | 104802aaf818505ec00980ea76c228f46ec70635 /activesupport/lib | |
parent | e466354edb31f243899051e2119f4ce72bafd5f3 (diff) | |
download | rails-a6e95ba55401ddcaf9ef867a080b30c2d07c56ac.tar.gz rails-a6e95ba55401ddcaf9ef867a080b30c2d07c56ac.tar.bz2 rails-a6e95ba55401ddcaf9ef867a080b30c2d07c56ac.zip |
fix mixed encoding logs can't be logged.
[#4807 state:committed]
Signed-off-by: Kouhei Sutou <kou@cozmixng.org>
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/buffered_logger.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/buffered_logger.rb b/activesupport/lib/active_support/buffered_logger.rb index 29c3843d16..b861a6f62a 100644 --- a/activesupport/lib/active_support/buffered_logger.rb +++ b/activesupport/lib/active_support/buffered_logger.rb @@ -101,7 +101,11 @@ module ActiveSupport @guard.synchronize do unless buffer.empty? old_buffer = buffer - @log.write(old_buffer.join) + all_content = StringIO.new + old_buffer.each do |content| + all_content << content + end + @log.write(all_content.string) end # Important to do this even if buffer was empty or else @buffer will |