changes to support multiple threads in jruby--fixes github issue #188 #214

Merged
merged 1 commit into from Aug 27, 2012
View
4 lib/dm-core/support/logger.rb
@@ -124,7 +124,9 @@ def set_log(log, log_level = nil, delimiter = " ~ ", auto_flush = false)
# Flush the entire buffer to the log object.
def flush
return unless @buffer.size > 0
- @log.write(@buffer.slice!(0..-1).join)
+ to_flush = @buffer
+ @buffer = []
+ @log.write(to_flush.join)
end
# Close and remove the current log object.