td-logger 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ == 2011-10-17 version 0.2.8
3
+
4
+ * Access logger checks to_msgpack for each values and nested values
5
+
6
+
2
7
  == 2011-10-09 version 0.2.7
3
8
 
4
9
  * Access logger checks respond_to?(:to_msgpack) for each values of params
@@ -22,6 +22,12 @@ module Agent
22
22
  :action => :action,
23
23
  }
24
24
 
25
+ class MessagePackedString < String
26
+ def to_msgpack(out = '')
27
+ out << self
28
+ end
29
+ end
30
+
25
31
  def self.enable_access_log(config)
26
32
  tag = config.access_log_table
27
33
 
@@ -61,10 +67,12 @@ module Agent
61
67
  # merge params
62
68
  req.params.each_pair {|key,val|
63
69
  key = key.to_sym
64
- if !record.has_key?(key) &&
65
- !filter_parameters.include?(key) &&
66
- val.respond_to?(:to_msgpack)
67
- record[key] = val
70
+ if !record.has_key?(key) && !filter_parameters.include?(key)
71
+ begin
72
+ record[key] = val.to_msgpack(MessagePackedString.new)
73
+ rescue
74
+ # ignore
75
+ end
68
76
  end
69
77
  }
70
78
 
@@ -1,7 +1,7 @@
1
1
  module TreasureData
2
2
  module Logger
3
3
 
4
- VERSION = '0.2.7'
4
+ VERSION = '0.2.8'
5
5
 
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td-logger
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 7
10
- version: 0.2.7
9
+ - 8
10
+ version: 0.2.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sadayuki Furuhashi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-09 00:00:00 +09:00
18
+ date: 2011-10-18 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency