td-logger 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/lib/td/logger/agent/rails.rb +6 -2
- data/lib/td/logger/version.rb +1 -1
- metadata +5 -5
data/ChangeLog
CHANGED
@@ -83,9 +83,13 @@ EOF
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def self.read_config(rails)
|
86
|
+
require 'yaml'
|
87
|
+
require 'erb'
|
86
88
|
logger = ::Rails.logger || ::Logger.new(STDOUT)
|
87
89
|
begin
|
88
|
-
|
90
|
+
src = File.read("#{rails_root}/#{CONFIG_PATH}")
|
91
|
+
yaml = ERB.new(src).result
|
92
|
+
env_conf = YAML.load(yaml)
|
89
93
|
rescue
|
90
94
|
logger.warn "Can't load #{CONFIG_PATH} file."
|
91
95
|
logger.warn " #{$!}"
|
@@ -94,7 +98,7 @@ EOF
|
|
94
98
|
return
|
95
99
|
end
|
96
100
|
|
97
|
-
conf =
|
101
|
+
conf = env_conf[rails_env]
|
98
102
|
unless conf
|
99
103
|
logger.warn "#{CONFIG_PATH} doesn't include setting for current environment (#{rails_env})."
|
100
104
|
logger.warn "Disabling Treasure Data logger."
|
data/lib/td/logger/version.rb
CHANGED
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:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
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-09-
|
18
|
+
date: 2011-09-08 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -120,6 +120,6 @@ rubyforge_project:
|
|
120
120
|
rubygems_version: 1.3.7
|
121
121
|
signing_key:
|
122
122
|
specification_version: 3
|
123
|
-
summary: Treasure Data logging library
|
123
|
+
summary: Treasure Data logging library for Rails
|
124
124
|
test_files: []
|
125
125
|
|