manageiq-loggers 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62e1317e69617340944c4b101d38210b7b0c0f5338a27575cb8cc46a74c286ac
4
- data.tar.gz: 9075da53591b01d2a5cebc39c2096b7969132d4b6a0462ed2a3fae7f26ed8101
3
+ metadata.gz: 8436652271025cd7faabe99d78bd9d27b5690fd49909cf889c2b9fd352abbd86
4
+ data.tar.gz: 2f5d7c4107e054ef821ae283376b08f40dac7f8451848ad257f14a0e5d11b1b3
5
5
  SHA512:
6
- metadata.gz: 79bb2f54cc014ef31a121f530b0d0115cb9388288d8a75dd1703d3ae0d9338b69dde905ec6ce6b1a523ad6ffdf9a4e51ad9aa6786fb3217d9b4ee001dba49b52
7
- data.tar.gz: 2bdae67116b57656be0d049c546da40391825311b6f42346820a464ab7d9d945b767716ff5e9e8a4c81e403dc8d0fe641011530c7f5c5aed1529bd500106f399
6
+ metadata.gz: abce2d09ce6efb68d5a36154f19ebe21a1d2eea7b7b16d82e0d427f9e696fb51907ed44ea19f7075622357413646e4a105062e0824ebda27e143d88ae3d733d2
7
+ data.tar.gz: c7aa682bdc273c3e917e3e13f560a63ed3560a669f74befd471271cdaeaaa982482a6fb1058226277ec0edc517bd57726c0c03d24202672bb26e0e4b21f54d9a
@@ -19,7 +19,6 @@ jobs:
19
19
  strategy:
20
20
  matrix:
21
21
  ruby-version:
22
- - '3.1'
23
22
  - '3.2'
24
23
  - '3.3'
25
24
  - '3.4'
@@ -29,7 +28,7 @@ jobs:
29
28
  env:
30
29
  TEST_RAILS_VERSION: "${{ matrix.rails-version }}"
31
30
  steps:
32
- - uses: actions/checkout@v6
31
+ - uses: actions/checkout@v7
33
32
  - name: Set up Ruby
34
33
  uses: ruby/setup-ruby@v1
35
34
  with:
data/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.1.0] - 2026-11-03
9
+ ### Changed
10
+ - Update the minimum ruby version to 3.2 [(#142)](https://github.com/ManageIQ/manageiq-loggers/pull/142)
11
+ - Set timezone for journald specs [(#128)](https://github.com/ManageIQ/manageiq-loggers/pull/128)
12
+ - Replace TZ env var with Time.use_zone in tests [(#134)](https://github.com/ManageIQ/manageiq-loggers/pull/134)
13
+
14
+ ### Fixed
15
+ - Fix JSON v3 unicode conversion [(#143)](https://github.com/ManageIQ/manageiq-loggers/pull/143)
16
+ - Fix running tests on macOS [(#132)](https://github.com/ManageIQ/manageiq-loggers/pull/132)
17
+ - Fix Journald#contents timestamp by using entry.realtime_timestamp [(#144)](https://github.com/ManageIQ/manageiq-loggers/pull/144)
18
+ - Fix contents raising error when line_count/max_count is nil [(#141)](https://github.com/ManageIQ/manageiq-loggers/pull/141)
19
+
8
20
  ## [2.0.0] - 2026-05-19
9
21
  ### Removed
10
22
  - **BREAKING** Remove the deprecated `current_request.request_id` [(#80)](https://github.com/ManageIQ/manageiq-loggers/pull/80)
@@ -110,7 +122,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
110
122
 
111
123
  ## [0.1.0] - 2019-01-08
112
124
 
113
- [Unreleased]: https://github.com/ManageIQ/manageiq-loggers/compare/v2.0.0...master
125
+ [Unreleased]: https://github.com/ManageIQ/manageiq-loggers/compare/v2.1.0...master
126
+ [2.1.0]: https://github.com/ManageIQ/manageiq-loggers/compare/v2.0.0...v2.1.0
114
127
  [2.0.0]: https://github.com/ManageIQ/manageiq-loggers/compare/v1.2.0...v2.0.0
115
128
  [1.2.0]: https://github.com/ManageIQ/manageiq-loggers/compare/v1.1.1...v1.2.0
116
129
  [1.1.1]: https://github.com/ManageIQ/manageiq-loggers/compare/v1.1.0...v1.1.1
@@ -26,7 +26,7 @@ module ManageIQ
26
26
  position = file_size
27
27
 
28
28
  # Read backwards in chunks until we have enough lines
29
- while position > 0 && lines.size < line_count
29
+ while position > 0 && (line_count.nil? || lines.size < line_count)
30
30
  # Calculate how much to read
31
31
  chunk_size = [buffer_size, position].min
32
32
  position -= chunk_size
@@ -53,7 +53,7 @@ module ManageIQ
53
53
  lines.unshift(partial_line) unless partial_line.empty?
54
54
  end
55
55
 
56
- lines.last(line_count)
56
+ line_count ? lines.last(line_count) : lines
57
57
  end
58
58
  end
59
59
  end
@@ -67,13 +67,12 @@ module ManageIQ
67
67
  journal.seek(:tail)
68
68
 
69
69
  results = []
70
- max_count.times do
70
+ loop do
71
+ break if max_count && results.size >= max_count
71
72
  break unless journal.move_previous
72
73
 
73
- entry = journal.current_entry
74
- # This is the time in microseconds since the epoch UTC, formatted as a decimal string.
75
- seconds_since_epoch = entry._source_realtime_timestamp.to_f / 1_000_000.0
76
- timestamp = Time.at(seconds_since_epoch).strftime("%Y-%m-%dT%H:%M:%S.%6N")
74
+ entry = journal.current_entry
75
+ timestamp = entry.realtime_timestamp.in_time_zone.iso8601(6)
77
76
 
78
77
  results << "[#{timestamp} ##{entry._pid}] #{entry.message}"
79
78
  end
@@ -37,10 +37,10 @@ module ManageIQ
37
37
  # :tags => "tags string",
38
38
  }.compact
39
39
  JSON.generate(payload) << "\n"
40
- rescue Encoding::UndefinedConversionError
40
+ rescue Encoding::UndefinedConversionError, JSON::GeneratorError
41
41
  raise unless msg.encoding == Encoding::ASCII_8BIT
42
42
 
43
- msg.force_encoding("UTF-8")
43
+ msg = msg.dup.force_encoding("UTF-8")
44
44
  retry
45
45
  end
46
46
 
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  module Loggers
3
- VERSION = "2.0.0".freeze
3
+ VERSION = "2.1.0".freeze
4
4
  end
5
5
  end
@@ -11,6 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = %q{Loggers for ManageIQ projects}
12
12
  spec.homepage = "https://github.com/ManageIQ/manageiq-loggers"
13
13
  spec.licenses = ["Apache-2.0"]
14
+ spec.required_ruby_version = ">= 3.2.0"
14
15
 
15
16
  # Specify which files should be added to the gem when it is released.
16
17
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -30,5 +31,5 @@ Gem::Specification.new do |spec|
30
31
  spec.add_development_dependency "rake", ">= 12.3.3"
31
32
  spec.add_development_dependency "rspec", "~> 3.0"
32
33
  spec.add_development_dependency "simplecov", ">= 0.21.2"
33
- spec.add_development_dependency "systemd-journal" if RbConfig::CONFIG['host_os'] =~ /linux/i
34
+ spec.add_development_dependency "systemd-journal" if RbConfig::CONFIG['host_os'].match?(/linux/i)
34
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-loggers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Authors
@@ -159,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
159
  requirements:
160
160
  - - ">="
161
161
  - !ruby/object:Gem::Version
162
- version: '0'
162
+ version: 3.2.0
163
163
  required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - ">="