Skip to content

Commit 461c25d

Browse files
committed
fix logger
1 parent c4c8ece commit 461c25d

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ LOCAL_GEM_ROOT = File.join(GEM_ROOT, 'tmp', 'local_gems').freeze
7777
if ENV['CI']
7878
# for ci testing only major rails versions
7979
if 'java' == RUBY_PLATFORM
80-
RAILS_VERSIONS = ['3.1.3', '3.2.5']
80+
RAILS_VERSIONS = ['3.1.6', '3.2.6']
8181
else
82-
RAILS_VERSIONS = ['3.1.3', '3.2.5']
82+
RAILS_VERSIONS = ['3.1.6', '3.2.6']
8383
end
8484
else
8585
RAILS_VERSIONS = IO.read('SUPPORTED_RAILS_VERSIONS').strip.split("\n")

SUPPORTED_RAILS_VERSIONS

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
3.1.1
33
3.1.2
44
3.1.3
5+
3.1.4
6+
3.1.5
7+
3.1.6
58
3.2.0
69
3.2.1
710
3.2.2
811
3.2.3
9-
3.2.5
12+
3.2.5
13+
3.2.6

lib/mongodb_logger/logger.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require 'mongo'
33
require 'active_support'
44
require 'active_support/core_ext'
5+
require 'active_support/core_ext/logger'
56
require 'action_dispatch/http/upload'
67
require 'mongodb_logger/replica_set_helper'
78

@@ -25,9 +26,8 @@ def initialize(options={})
2526
Rails.env.production? ? (raise e) : (puts "MongodbLogger WARNING: Using BufferedLogger due to exception: " + e.message)
2627
ensure
2728
if disable_file_logging?
28-
@buffer = {}
29-
@auto_flushing = 1
30-
@guard = Mutex.new
29+
@log = ::Logger.new(STDOUT)
30+
@log.level = @level
3131
else
3232
super(path, @level)
3333
end

test/unit/mongodb_logger_test.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,8 @@ class MongodbLogger::LoggerTest < Test::Unit::TestCase
243243
MongodbLogger::Logger.new
244244
end
245245

246-
should "set buffer" do
247-
assert_equal({}, MongodbLogger::Logger.new.instance_variable_get(:@buffer))
248-
end
249-
should "set guard" do
250-
assert MongodbLogger::Logger.new.instance_variable_get(:@guard).is_a?(Mutex)
246+
should "set log" do
247+
assert MongodbLogger::Logger.new.instance_variable_get(:@log).is_a?(Logger)
251248
end
252249
end
253250

0 commit comments

Comments
 (0)