td-logger 0.3.14 → 0.3.15
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +6 -0
- data/VERSION +1 -1
- data/lib/td/logger/agent/rails/controller.rb +6 -15
- data/lib/td/logger/agent/rails/model.rb +4 -14
- data/lib/td/logger/agent/rails.rb +8 -0
- data/lib/td/logger/version.rb +1 -1
- data/spec/rails_config_spec.rb +10 -0
- metadata +2 -3
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.15
|
@@ -7,24 +7,15 @@ module Agent::Rails
|
|
7
7
|
::ActionController::Base.send(:include, self)
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
def self.included(mod)
|
15
|
-
im = InstanceMethods
|
16
|
-
cm = ClassMethods
|
17
|
-
mod.class_eval do
|
18
|
-
include im
|
19
|
-
extend cm
|
20
|
-
end
|
10
|
+
def self.included(mod)
|
11
|
+
cm = ClassMethods
|
12
|
+
mod.class_eval do
|
13
|
+
extend cm
|
21
14
|
end
|
22
15
|
end
|
23
16
|
|
24
|
-
|
25
|
-
|
26
|
-
TreasureData::Logger.event
|
27
|
-
end
|
17
|
+
def event
|
18
|
+
TreasureData::Logger.event
|
28
19
|
end
|
29
20
|
|
30
21
|
module ClassMethods
|
@@ -14,23 +14,13 @@ module Agent::Rails
|
|
14
14
|
::ActiveRecord::Base.send(:include, self)
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
def self.included(mod)
|
22
|
-
im = InstanceMethods
|
23
|
-
cm = ClassMethods
|
24
|
-
mod.class_eval do
|
25
|
-
include im
|
26
|
-
extend cm
|
27
|
-
end
|
17
|
+
def self.included(mod)
|
18
|
+
cm = ClassMethods
|
19
|
+
mod.class_eval do
|
20
|
+
extend cm
|
28
21
|
end
|
29
22
|
end
|
30
23
|
|
31
|
-
module InstanceMethods
|
32
|
-
end
|
33
|
-
|
34
24
|
module ClassMethods
|
35
25
|
def td_enable_model_tracer(tag, options={})
|
36
26
|
only = nil
|
@@ -47,6 +47,14 @@ module Agent::Rails
|
|
47
47
|
TreasureData::Logger::Agent::Rails.init(::Rails.configuration)
|
48
48
|
end
|
49
49
|
|
50
|
+
# implement ActiveSupport::TimeWithZone#to_msgpack
|
51
|
+
unless ActiveSupport::TimeWithZone.method_defined?(:to_msgpack)
|
52
|
+
class ActiveSupport::TimeWithZone
|
53
|
+
def to_msgpack(out='')
|
54
|
+
strftime("%Y-%m-%d %H:%M:%S %z").to_msgpack(out)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
50
58
|
end
|
51
59
|
end
|
52
60
|
end
|
data/lib/td/logger/version.rb
CHANGED
data/spec/rails_config_spec.rb
CHANGED
@@ -36,6 +36,11 @@ class ActionController
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
class ActiveSupport
|
40
|
+
class TimeWithZone
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
39
44
|
require 'td/logger/agent/rails'
|
40
45
|
|
41
46
|
describe TreasureData::Logger::Agent::Rails::Config do
|
@@ -114,3 +119,8 @@ EOF
|
|
114
119
|
end
|
115
120
|
end
|
116
121
|
|
122
|
+
describe ActiveSupport::TimeWithZone do
|
123
|
+
it 'has to_msgpack' do
|
124
|
+
ActiveSupport::TimeWithZone.method_defined?(:to_msgpack).should be_true
|
125
|
+
end
|
126
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: td-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.15
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: msgpack
|
@@ -147,4 +147,3 @@ test_files:
|
|
147
147
|
- spec/rails_config_spec.rb
|
148
148
|
- spec/spec_helper.rb
|
149
149
|
- spec/td_logger_spec.rb
|
150
|
-
has_rdoc:
|