td-logger 0.3.16 → 0.3.17

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ == 2012-12-11 version 0.3.17
2
+
3
+ * Use at_exit to prevent SEGV on exit. issue #5
4
+ * Add example config for Heroku users
5
+
6
+
1
7
  == 2012-11-17 version 0.3.16
2
8
 
3
9
  * Disable logger when the key for the ennvironment is missing. issue #6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.16
1
+ 0.3.17
@@ -0,0 +1,36 @@
1
+ #
2
+ # This file configures the Treasure Data, Hadoop-based cloud data warehouse.
3
+ # For more information, visit http://www.treasure-data.com/.
4
+ #
5
+ production:
6
+ # Treasure Data API Key
7
+ # TREASURE_DATA_API_KEY is automatically defined when you add treasure-data
8
+ # heroku addon.
9
+ apikey: "<%= ENV['TREASURE_DATA_API_KEY'] %>"
10
+
11
+ # Database name
12
+ # Set this to be the name of your database as you'd like it show up in
13
+ # `heroku td dbs` command.
14
+ database: production
15
+
16
+ # Debug Mode
17
+ # Less verbose for production environment.
18
+ debug_mode: false
19
+
20
+ # For development environment, logging to Treasure Data is disabled by default.
21
+ development:
22
+ # Treasure Data API Key
23
+ # `heroku td apikey:show` will retrieve the apikey through Heroku API.
24
+ # apikey: "<%= `heroku td apikey:show`.strip %>"
25
+
26
+ # Database name
27
+ # Set this to be the name of your database as you'd like it show up in
28
+ # `heroku td dbs` command.
29
+ # database: development
30
+
31
+ # Debug Mode
32
+ # More verbose tracing is enabled for development environment.
33
+ # debug_mode: true
34
+
35
+ # For test environment, logging to Treasure Data is disabled by default.
36
+ test:
@@ -3,25 +3,6 @@ module Logger
3
3
 
4
4
 
5
5
  class TreasureDataLogger < Fluent::Logger::LoggerBase
6
- module Finalizable
7
- require 'delegate'
8
- def new(*args, &block)
9
- obj = allocate
10
- obj.instance_eval { initialize(*args, &block) }
11
- dc = DelegateClass(obj.class).new(obj)
12
- ObjectSpace.define_finalizer(obj, finalizer(obj))
13
- dc
14
- end
15
-
16
- def finalizer(obj)
17
- fin = obj.method(:finalize)
18
- proc {|id|
19
- fin.call
20
- }
21
- end
22
- end
23
- extend Finalizable
24
-
25
6
  def initialize(tag_prefix, options={})
26
7
  defaults = {
27
8
  :auto_create_table => false,
@@ -78,6 +59,10 @@ class TreasureDataLogger < Fluent::Logger::LoggerBase
78
59
  # start thread when the first post() is called for
79
60
  # Unicorn and Passenger.
80
61
  @upload_thread = nil
62
+
63
+ # The calling order of finalizer registered by define_finalizer is indeterminate,
64
+ # so we should use at_exit instead for memory safety.
65
+ at_exit { close }
81
66
  end
82
67
 
83
68
  attr_accessor :logger
@@ -344,10 +329,6 @@ class TreasureDataLogger < Fluent::Logger::LoggerBase
344
329
  end
345
330
  end
346
331
 
347
- def finalize
348
- close
349
- end
350
-
351
332
  require 'thread' # ConditionVariable
352
333
  if ConditionVariable.new.method(:wait).arity == 1
353
334
  # "WARNING: Running on Ruby 1.8. Ruby 1.9 is recommended."
@@ -1,7 +1,7 @@
1
1
  module TreasureData
2
2
  module Logger
3
3
 
4
- VERSION = '0.3.16'
4
+ VERSION = '0.3.17'
5
5
 
6
6
  end
7
7
  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.16
4
+ version: 0.3.17
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-11-16 00:00:00.000000000 Z
12
+ date: 2012-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -103,6 +103,7 @@ files:
103
103
  - README.rdoc
104
104
  - Rakefile
105
105
  - VERSION
106
+ - config/heroku/treasure_data.yml
106
107
  - lib/td-logger.rb
107
108
  - lib/td/logger.rb
108
109
  - lib/td/logger/agent/rack.rb
@@ -130,12 +131,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
131
  - - ! '>='
131
132
  - !ruby/object:Gem::Version
132
133
  version: '0'
134
+ segments:
135
+ - 0
136
+ hash: -4555747139557517598
133
137
  required_rubygems_version: !ruby/object:Gem::Requirement
134
138
  none: false
135
139
  requirements:
136
140
  - - ! '>='
137
141
  - !ruby/object:Gem::Version
138
142
  version: '0'
143
+ segments:
144
+ - 0
145
+ hash: -4555747139557517598
139
146
  requirements: []
140
147
  rubyforge_project:
141
148
  rubygems_version: 1.8.23