fluent-logger 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +7 -0
- data/VERSION +1 -1
- data/lib/fluent/logger.rb +6 -2
- data/lib/fluent/logger/fluent_logger.rb +8 -2
- data/lib/fluent/logger/logger_base.rb +5 -1
- data/lib/fluent/logger/null_logger.rb +1 -1
- data/lib/fluent/logger/test_logger.rb +1 -1
- data/lib/fluent/logger/text_logger.rb +1 -2
- data/lib/fluent/logger/version.rb +1 -1
- metadata +16 -16
data/ChangeLog
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
|
2
|
+
Release 0.4.1 - 2011/11/07
|
3
|
+
|
4
|
+
* added Logger#post_with_time(tag, map, time)
|
5
|
+
* Logger#post(tag, map, time=Time.now) -> Logger#post(tag, map)
|
6
|
+
* FluentLogger supports :debug=>true option to write all events to STDERR
|
7
|
+
|
8
|
+
|
2
9
|
Release 0.4.0 - 2011/11/05
|
3
10
|
|
4
11
|
* Wait before reconnecting to fluentd to prevent burst
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/fluent/logger.rb
CHANGED
@@ -48,8 +48,12 @@ module Logger
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
def self.post(tag, map
|
52
|
-
@@default_logger.post(tag, map
|
51
|
+
def self.post(tag, map)
|
52
|
+
@@default_logger.post(tag, map)
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.post_with_time(tag, map, time)
|
56
|
+
@@default_logger.post_with_time(tag, map, time)
|
53
57
|
end
|
54
58
|
|
55
59
|
def self.default
|
@@ -81,7 +81,13 @@ class FluentLogger < LoggerBase
|
|
81
81
|
@connect_error_history = []
|
82
82
|
|
83
83
|
@limit = options[:buffer_limit] || BUFFER_LIMIT
|
84
|
+
|
84
85
|
@logger = options[:logger] || ::Logger.new(STDERR)
|
86
|
+
if options[:debug]
|
87
|
+
@logger.level = ::Logger::DEBUG
|
88
|
+
else
|
89
|
+
@logger.level = ::Logger::INFO
|
90
|
+
end
|
85
91
|
|
86
92
|
begin
|
87
93
|
connect!
|
@@ -93,8 +99,8 @@ class FluentLogger < LoggerBase
|
|
93
99
|
|
94
100
|
attr_accessor :limit, :logger
|
95
101
|
|
96
|
-
def
|
97
|
-
|
102
|
+
def post_with_time(tag, map, time)
|
103
|
+
@logger.debug { "event: #{tag} #{map.to_json}" rescue nil }
|
98
104
|
tag = "#{@tag_prefix}.#{tag}" if @tag_prefix
|
99
105
|
write [tag, time.to_i, map]
|
100
106
|
end
|
@@ -24,8 +24,7 @@ class TextLogger < LoggerBase
|
|
24
24
|
@time_format = "%b %e %H:%M:%S"
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
28
|
-
time ||= Time.now
|
27
|
+
def post_with_time(tag, map, time)
|
29
28
|
a = [time.strftime(@time_format), " ", tag, ":"]
|
30
29
|
map.each_pair {|k,v|
|
31
30
|
a << " #{k}="
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-07 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yajl-ruby
|
16
|
-
requirement: &
|
16
|
+
requirement: &70207037595840 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70207037595840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: msgpack
|
27
|
-
requirement: &
|
27
|
+
requirement: &70207037595300 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.4.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70207037595300
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70207037594800 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70207037594800
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &70207037594340 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.7.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70207037594340
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: simplecov
|
60
|
-
requirement: &
|
60
|
+
requirement: &70207037593860 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.5.4
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70207037593860
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: timecop
|
71
|
-
requirement: &
|
71
|
+
requirement: &70207037593340 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 0.3.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70207037593340
|
80
80
|
description: fluent logger for ruby
|
81
81
|
email: frsyuki@gmail.com
|
82
82
|
executables: []
|
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
segments:
|
128
128
|
- 0
|
129
|
-
hash:
|
129
|
+
hash: 3162457063244932466
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
none: false
|
132
132
|
requirements:
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
segments:
|
137
137
|
- 0
|
138
|
-
hash:
|
138
|
+
hash: 3162457063244932466
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
141
|
rubygems_version: 1.8.10
|