fluent-logger 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00161d7e89f54b0c1627bb5b0ce36a7689405b84da319db5c4052e585c09f6a7
4
- data.tar.gz: fc7229efbe7fb40412fe22080aa974156f49f7d5e4257c0071d82eb7359cca72
3
+ metadata.gz: 460c4365ba58c7558db145e551b806ee8b2afb764454bfbba35e6f6290093317
4
+ data.tar.gz: 5166f31570a03e934c217464a2d16706f82bd650581f43d83ee87c53e0952da8
5
5
  SHA512:
6
- metadata.gz: 1066053b93cf4173b29e063659d7f80bb42b77a116b85b2a18f3d43cf19c54538359336b4b120d0ff43b65cc58110ae8a3357a52f417a0379ea09c306e27b808
7
- data.tar.gz: 8c7839a41b615ccf34ebcd656c1719ba99245c39abe9981969b8cb7d1a9cf57ad972dfb8276ebffe4c8c132d95d2a1dfc1db5b354bfc720b4a7c569722688a33
6
+ metadata.gz: 443b59cb242dc22e0d7ec6e711aefc2274452b5ea19d04af73db8250683f27da15b731af24b137213d91ea1f9c91873e7c5b85302c461c3f312b5d19e4bed2b7
7
+ data.tar.gz: 3e1d99bb86d51e2e589621e73ad763de5928e19aa1a15d470fa7adc616a749674df69356b8bd431d07804a8f5925bcb8742c98a560e99f6ff35abf2f423c439e
@@ -0,0 +1,30 @@
1
+ name: linux
2
+ on:
3
+ - push
4
+ - pull_request
5
+ jobs:
6
+ build:
7
+ runs-on: ${{ matrix.os }}
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby:
12
+ - '2.7'
13
+ - '3.0'
14
+ - '3.1'
15
+ - '3.2'
16
+ os:
17
+ - ubuntu-latest
18
+ name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+ - uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ - name: unit testing
25
+ env:
26
+ CI: true
27
+ run: |
28
+ gem install bundler rake
29
+ bundle install --jobs 4 --retry 3
30
+ bundle exec rake spec
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Release 0.9.1 - 2023/12/20
2
+
3
+ * Fix invalid message polluting subsequent message
4
+
1
5
  Release 0.9.0 - 2020/09/04
2
6
 
3
7
  * FluentLogger supports TLS
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fluent logger
2
2
 
3
- [![Build Status](https://travis-ci.org/fluent/fluent-logger-ruby.svg?branch=master)](https://travis-ci.org/fluent/fluent-logger-ruby)
3
+ [![Build Status](https://github.com/fluent/fluent-logger-ruby/actions/workflows/linux.yml/badge.svg?branch=master)](https://github.com/fluent/fluent-logger-ruby/actions/workflows/linux.yml)
4
4
 
5
5
  A structured event logger
6
6
 
@@ -101,7 +101,7 @@ log = Fluent::Logger::FluentLogger.new(nil, :host => 'localhost', :port => 24224
101
101
  ```
102
102
  <source>
103
103
  @type forward
104
- <transport tcp>
104
+ <transport tls>
105
105
  version TLS1_2
106
106
  ca_path /path/to/cacert.pem
107
107
  cert_path /path/to/server-cert.pem
@@ -245,7 +245,7 @@ Fluent::Logger::NullLogger.open
245
245
 
246
246
  To send events with nanosecond-precision time (Fluent 0.14 and up), specify `nanosecond_precision` to `FluentLogger` constructor.
247
247
 
248
- ```rb
248
+ ```ruby
249
249
  log = Fluent::Logger::FluentLogger.new(nil, :host => 'localhost', :port => 24224, :nanosecond_precision => true)
250
250
  # Use nanosecond time instead
251
251
  log.post("myapp.access", {"agent" => "foo"})
@@ -259,7 +259,7 @@ You can inject your own custom proc to handle buffer overflow in the event of co
259
259
  Your proc must accept a single argument, which will be the internal buffer of messages from the logger. A typical use-case for this would be writing to disk or possibly writing to Redis.
260
260
 
261
261
  ##### Example
262
- ```
262
+ ```ruby
263
263
  class BufferOverflowHandler
264
264
  attr_accessor :buffer
265
265
 
@@ -27,4 +27,5 @@ Gem::Specification.new do |gem|
27
27
  gem.add_development_dependency 'rspec-its', '>= 1.1.0'
28
28
  gem.add_development_dependency 'simplecov', '>= 0.5.4'
29
29
  gem.add_development_dependency 'timecop', '>= 0.3.0'
30
+ gem.add_development_dependency 'webrick'
30
31
  end
@@ -231,8 +231,9 @@ module Fluent
231
231
  @packer.pack(msg).to_s
232
232
  rescue NoMethodError
233
233
  JSON.parse(JSON.generate(msg)).to_msgpack
234
+ ensure
235
+ @packer.clear
234
236
  end
235
- @packer.clear
236
237
  res
237
238
  }
238
239
  end
@@ -1,5 +1,5 @@
1
1
  module Fluent
2
2
  module Logger
3
- VERSION = '0.9.0'
3
+ VERSION = '0.9.1'
4
4
  end
5
5
  end
@@ -205,6 +205,10 @@ describe Fluent::Logger::FluentLogger do
205
205
  expect(fluentd.queue.last).to be_nil
206
206
  logger_io.rewind
207
207
  logger_io.read =~ /FluentLogger: Can't convert to msgpack:/
208
+
209
+ logger.post('tag', { 'a' => 'b' })
210
+ fluentd.wait_transfer
211
+ expect(fluentd.queue.last).to eq ['logger-test.tag', { 'a' => 'b' }]
208
212
  }
209
213
 
210
214
  it ('should raise an error when second argument is non hash object') {
@@ -382,6 +386,16 @@ describe Fluent::Logger::FluentLogger do
382
386
 
383
387
  before(:each) do
384
388
  fluentd.startup(true)
389
+ # Make sure to wait TLS server since preparing it takes longer time than
390
+ # non-TLS so that it might be too early especially on CI environment
391
+ 3.times do
392
+ begin
393
+ TCPSocket.open('localhost', fluentd.port) {}
394
+ break
395
+ rescue
396
+ fluentd.wait_transfer
397
+ end
398
+ end
385
399
  end
386
400
 
387
401
  after(:each) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2023-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -100,6 +100,20 @@ dependencies:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: 0.3.0
103
+ - !ruby/object:Gem::Dependency
104
+ name: webrick
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
103
117
  description: fluent logger for ruby
104
118
  email: frsyuki@gmail.com
105
119
  executables:
@@ -107,9 +121,9 @@ executables:
107
121
  extensions: []
108
122
  extra_rdoc_files: []
109
123
  files:
124
+ - ".github/workflows/linux.yml"
110
125
  - ".gitignore"
111
126
  - ".rspec"
112
- - ".travis.yml"
113
127
  - AUTHORS
114
128
  - COPYING
115
129
  - ChangeLog
@@ -161,20 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
175
  - !ruby/object:Gem::Version
162
176
  version: '0'
163
177
  requirements: []
164
- rubygems_version: 3.1.2
178
+ rubygems_version: 3.4.1
165
179
  signing_key:
166
180
  specification_version: 4
167
181
  summary: fluent logger for ruby
168
- test_files:
169
- - spec/console_logger_spec.rb
170
- - spec/fluent_logger_spec.rb
171
- - spec/level_fluent_logger_spec.rb
172
- - spec/logger_base_spec.rb
173
- - spec/logger_spec.rb
174
- - spec/null_logger_spec.rb
175
- - spec/plugin/out_test.rb
176
- - spec/spec_helper.rb
177
- - spec/support/dummy_fluentd.rb
178
- - spec/support/dummy_serverengine.rb
179
- - spec/support/timecop.rb
180
- - spec/test_logger_spec.rb
182
+ test_files: []
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- rvm:
2
- - 2.4.10
3
- - 2.5
4
- - 2.6
5
- - 2.7
6
- - ruby-head
7
-
8
- gemfile:
9
- - Gemfile
10
-
11
- before_install: gem update bundler
12
- script: bundle exec rake spec
13
-
14
- sudo: false
15
-
16
- matrix:
17
- allow_failures:
18
- - rvm: ruby-head