betterlog 2.5.0 → 2.5.1

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: 1df9b206ed77e7c1168ee809c4fb2807b63236bcfae274a4e2a8e019d406faaa
4
- data.tar.gz: 255322fb895a3cd1f505d1d1ce981d4aa343526d5c9605371b9e29023857b402
3
+ metadata.gz: ad7b5eaa440c602c2ca06da38b75431c28315d220d9f2fe3a2e70f60e76eca03
4
+ data.tar.gz: 3eec6510d36b5b5551a0c05b97f9b5d71b272fcba157ad26d56a51761c5e2621
5
5
  SHA512:
6
- metadata.gz: 0fef548692a3a7dbca542b1ba54700a111a862e27cc016054be4a8330913f3605a51bbc755b5ac32e43958fff74faf1e57be37dc33c62a4f0aea32608b17ce31
7
- data.tar.gz: d109c3819a1d2292552ec3d2a314aab59bee39dfa9492163d11cc87f208966d6e2ee94194fac47170b247c3f3b39673c4cbeb11d284f718e235e775f8db52d1a
6
+ metadata.gz: 9514290abd230a5fb89fbd8eafc4d6146ad340671fb92399adc63eb0992c875633c0398de04c1ed40418981ad15746ca71f24d194994cbefa5c79253603ffc2a
7
+ data.tar.gz: f65401d22cb2b33991a9944254244b209f40fe1f651acee9b05bd39961b1061101dc6c89aa54cdfaff4e527ee5dbf4444f840033a23f85be04eeb3bcd0d4e35e
data/CHANGES.md CHANGED
@@ -1,47 +1,75 @@
1
1
  # Changes
2
2
 
3
- ## 2026-11-20 v2.5.0
3
+ ## 2026-11-23 v2.5.1
4
4
 
5
5
  ### Improvements
6
6
 
7
- - Widened the `json` dependency constraint from `~> 2.0` to `>= 2.0, < 4` in
8
- `Rakefile` and `betterlog.gemspec` to allow compatibility with `json`
9
- **3.x**.
7
+ - Added a GitHub Pages workflow to deploy YARD documentation from the `doc/`
8
+ directory to GitHub Pages on pushes to `master` and via manual
9
+ `workflow_dispatch`.
10
+ - Renamed the `## Download` section in `README.md` to `## Links` and added a
11
+ link to the YARD documentation hosted on GitHub Pages.
12
+
13
+ ### Documentation
14
+
15
+ - Corrected the `-s` flag description in `README.md` to state that it "shows only" matching events, rather than "filters out" non-matching ones.
16
+ - Updated the `-p FORMAT` example in `README.md` from `long, short` to `long,
17
+ legacy` to match the formats defined in the example `log.yml`.
18
+ - Updated the architecture and sequence diagrams in `README.md` to remove
19
+ `EventFormatter` from the library logging path, clarifying that it is a
20
+ CLI-only component.
21
+ - Added a separate `CLI (betterlog binary)` subgraph to the architecture
22
+ diagram in `README.md`.
23
+ - Renamed `LegacyFormatter` to `LegacyEventFormatter` in the architecture
24
+ diagram in `README.md`.
25
+ - Added a note under the Installation section in `README.md` specifying the
26
+ Ruby `>= 3.2` requirement.
27
+ - Restructured `CHANGES.md` to categorize historical entries (v0.2.0–v2.3.0)
28
+ into standard sections such as `Breaking`, `Features`, `Fixes`,
29
+ `Improvements`, `Build & CI`, `Testing`, and `Documentation`.
30
+ - Compressed the v2.4.0 YARD accuracy findings in `CHANGES.md` into a single
31
+ summary entry.
32
+ - Trimmed the v2.5.0 entry in `CHANGES.md` to focus on the `json` dependency
33
+ widening and `redlock` removal.
34
+
35
+ ### Build & CI
36
+
37
+ - Registered `github_workflows('static.yml' => {})` in `Rakefile` to ensure
38
+ `gem_hadar` tracks the new workflow file.
39
+
40
+ ## 2026-11-20 v2.5.0
41
+
42
+ ### Improvements
43
+ - Widened the `json` dependency constraint from `~> 2.0` to `>= 2.0, < 4`
44
+ to allow compatibility with `json` **3.x**.
10
45
  - Removed the unused `redlock` runtime dependency from `Rakefile` and
11
46
  `betterlog.gemspec`.
12
47
 
13
48
  ## 2026-11-20 v2.4.0
14
49
 
15
50
  ### Fixes
16
-
17
- - Corrected YARD documentation accuracy across multiple files:
18
- - Removed redundant `@return [ void ]` tag from
19
- `Betterlog::GlobalMetadata#remove`.
20
- - Broadened `@return` for `Betterlog::Log::Event.is?` to `[ Boolean, nil ]`
21
- and clarified the `nil` return case.
22
- - Updated `@param rest` documentation for `Betterlog::Log::Event.ify` and
23
- `Betterlog::Log` methods (`info`, `warn`, `debug`, `error`, `fatal`,
24
- `output`) to use specific `@option` tags for `:meta`, `:severity`, and
25
- `:notify`, with a `@note` for additional keyword arguments.
26
- - Escaped braces in `Betterlog::Log::EventFormatter#colorize` documentation
27
- to prevent misparsing of log-format DSL syntax.
28
- - Updated `Betterlog::Notifiers.notify` documentation to accurately reflect
29
- the implementation.
51
+ - Corrected YARD documentation accuracy across multiple files,
52
+ including removing the `@return [ void ]` tag from
53
+ `Betterlog::GlobalMetadata#remove`, broadening the `@return` for
54
+ `Betterlog::Log::Event.is?`, and updating parameter documentation for
55
+ `Betterlog::Log::Event.ify` and `Betterlog::Log` methods to use
56
+ specific `@option` tags.
57
+ - Escaped braces in `Betterlog::Log::EventFormatter#colorize`
58
+ documentation to prevent misparsing of log-format DSL syntax.
59
+ - Updated `Betterlog::Notifiers.notify` documentation to accurately
60
+ reflect the implementation.
30
61
 
31
62
  ### Improvements
32
-
33
- - Optimized `Betterlog::Notifiers.notify` to serialize the event JSON once and
34
- hoist context setting out of the notifier loop, reducing complexity from
35
- O(N²) to O(N).
36
- - Removed dead code `Betterlog::Log#build_metric` which had no call sites.
63
+ - Optimized `Betterlog::Notifiers.notify` to serialize event JSON once
64
+ and hoist context setting out of the notifier loop, reducing
65
+ complexity from O(N²) to O(N).
66
+ - Removed dead code `Betterlog::Log#build_metric`.
37
67
 
38
68
  ### Build & CI
39
-
40
69
  - Updated Ruby version from **3.4.8** to **3.4.13** in `.tool-versions`
41
- (picks up the 18 Nov 2026 Ruby advisory: 7 RCE-grade Regexp/String
42
- case-conversion GHSAs + ~46 memory-safety fixes).
43
- - Updated `gem_hadar` development dependency constraint from `>= 2.16.3` to `>=
44
- 2.24.1` in `betterlog.gemspec`.
70
+ to include recent security advisories and memory-safety fixes.
71
+ - Updated `gem_hadar` development dependency constraint from
72
+ **>= 2.16.3** to **>= 2.24.1** in `betterlog.gemspec`.
45
73
  - Regenerated `lib/betterlog/version.rb`, `Gemfile`, and `Rakefile` via
46
74
  `gem_hadar`, removing stale vim modeline comments.
47
75
  - Updated ignore patterns in `Rakefile` and `.gitignore` to replace
@@ -49,386 +77,707 @@
49
77
 
50
78
  ## 2026-01-08 v2.3.0
51
79
 
52
- - Updated `required_ruby_version` from `~> 3.2` to `>= 3.2` in `Rakefile` and
53
- `betterlog.gemspec`
54
- - Added `readline-dev` to Dockerfile for readline support
55
- - Replaced `bundle` and `rake spec` with `bundle update --all`, `bundle
56
- install`, and `bundle exec rake spec` in `.all_images.yml`
57
- - Added Ruby **4.0-alpine** support to CI matrix
58
- - Updated `Gemfile` to use `>= 3.2` for `required_ruby_version`
80
+ ### Features
81
+ - Added support for Ruby **4.0-alpine** to the CI matrix.
82
+ - Changed `required_ruby_version` from `~> 3.2` to `>= 3.2` in
83
+ `Rakefile` and `betterlog.gemspec`.
84
+
85
+ ### Build & CI
86
+ - Added `readline-dev` to the Dockerfile for readline support.
87
+ - Replaced `bundle` and `rake spec` with `bundle update --all`,
88
+ `bundle install`, and `bundle exec rake spec` in `.all_images.yml`.
89
+ - Updated `Gemfile` to use `>= 3.2` for `required_ruby_version`.
59
90
 
60
91
  ## 2026-01-05 v2.2.1
61
92
 
62
- - Migrated all CI/CD pipelines from Ubuntu 20.04 to Ubuntu **24.04**
63
- - Updated `gem_hadar` development dependency to **2.16.3** or higher
64
- - Added `changelog` configuration to `Rakefile` to generate `CHANGES.md`
65
- - Improved severity filtering
66
- - Improved robustness by using safe navigation operator
67
- (`&.`) when accessing `@opts[?S]`
68
- - Enhanced severity handling by explicitly converting severities into array
69
- - Ensured severity filtering works correctly even when no severity options are
70
- provided
93
+ ### Improvements
94
+ - Improved severity filtering by using the safe navigation operator
95
+ (`&.`) when accessing `@opts[?S]`.
96
+ - Enhanced severity handling by explicitly converting severities into an
97
+ array using `.to_a`.
98
+
99
+ ### Build & CI
100
+ - Migrated all CI/CD pipelines from Ubuntu 20.04 to Ubuntu **24.04**.
101
+ - Updated the `gem_hadar` development dependency to **2.16.3** or higher.
102
+ - Added `changelog` configuration to the `Rakefile` to generate
103
+ `CHANGES.md`.
104
+
105
+ ### Documentation
106
+ - Added a new entry for version **2.2.1** to `CHANGES.md`.
71
107
 
72
108
  ## 2025-11-14 v2.2.0
73
109
 
74
- - Updated `tins` runtime dependency from "~> 1.3" with ">= 1.22.0" to "~> 1.47"
75
- - Modified `@opts[?F]` to `@opts[?F].to_a` in `betterlog` binary to ensure
76
- proper array handling
77
- - Updated `gem_hadar` development dependency from version **1.28** to **2.8**
78
- - Added `openssl-dev` to the list of packages installed via `apk add` in
79
- Dockerfile
80
- - The change affects the `dockerfile` section in `.all_images.yml`
110
+ ### Features
111
+ - Updated the `tins` runtime dependency from `~> 1.3` with
112
+ `>= 1.22.0` to `~> 1.47` in `Rakefile` and
113
+ `betterlog.gemspec`.
114
+
115
+ ### Fixes
116
+ - Modified `@opts[?F]` to `@opts[?F].to_a` in the `betterlog`
117
+ binary to ensure proper array handling.
118
+
119
+ ### Build & CI
120
+ - Updated the `gem_hadar` development dependency from version
121
+ **1.28** to **2.8** in `betterlog.gemspec`.
122
+ - Added `openssl-dev` to the list of packages installed via
123
+ `apk add` in the Dockerfile within `.all_images.yml`.
81
124
 
82
125
  ## 2025-09-04 v2.1.4
83
126
 
84
- - Updated gem version to **2.1.4** across all relevant files
85
- - Modified `VERSION` file to reflect new version **2.1.4**
86
- - Updated `betterlog.gemspec` to use version **2.1.4** in gem specification
87
- - Changed `lib/betterlog/version.rb` to set `VERSION` constant to **2.1.4**
88
- - Completely rewrote `README.md` with comprehensive documentation
127
+ ### Documentation
128
+
129
+ - Completely rewrote `README.md` with comprehensive documentation, including
130
+ installation, usage, CLI options, architecture, configuration, and Rails
131
+ integration.
132
+ - Updated copyright notice in `LICENSE` from `Florian Frank` to
133
+ `betterplace`.
89
134
 
90
135
  ## 2025-09-03 v2.1.3
91
136
 
92
- - Improved documentation for the `colorize` method with detailed styling examples
93
- - Enhanced documentation for the `format_pattern` method with a detailed syntax guide
94
- - Added `doc` directory to `.gitignore` and updated `Rakefile` to include it in the ignore list
137
+ ### Build & CI
138
+ - Added the `doc` directory to `.gitignore` and the `Rakefile`
139
+ ignore list, and removed `errors.lst` from the `Rakefile` ignore
140
+ list.
141
+
142
+ ### Documentation
143
+ - Improved documentation for the `colorize` method in
144
+ `lib/betterlog/log/event_formatter.rb` with detailed styling
145
+ examples.
146
+ - Enhanced documentation for the `format_pattern` method with a
147
+ detailed syntax guide.
95
148
 
96
149
  ## 2025-09-02 v2.1.2
97
150
 
98
- - Moved only `filter_severities` method to private scope
151
+ ### Fixes
152
+ - Moved the `filter_severities` method to private scope
99
153
 
100
154
  ## 2025-09-02 v2.1.1
101
155
 
156
+ ### Breaking
102
157
  - Set required Ruby version to ~> **3.2** in both `Rakefile` and
103
- `betterlog.gemspec`
104
- - Added `.all_images.yml`, `.tool-versions`, `.gitignore`, and files under
105
- `.semaphore/` and `.github/` to package_ignore in `Rakefile`
158
+ `betterlog.gemspec`.
159
+ - Removed support for Ruby version **3.1** in the docker image
160
+ configuration.
161
+
162
+ ### Documentation
106
163
  - Added comprehensive documentation to the `Betterlog::App` class, including
107
- detailed class documentation, method documentation with parameters and return
108
- values, and improved code organization with comments
109
- - Removed ruby version **3.1** from the image list in `.all_images.yml`
110
- - Added `CHANGES.md` file to document project history and version updates
164
+ detailed class and method documentation.
165
+ - Added a new `CHANGES.md` file to document project history.
166
+
167
+ ### Build & CI
168
+ - Added `.all_images.yml`, `.tool-versions`, `.gitignore`, and files under
169
+ `.semaphore/` and `.github/` to `package_ignore` in `Rakefile`.
170
+ - Added `CHANGES.md` to the list of files in the gemspec.
111
171
 
112
172
  ## 2025-09-02 v2.1.0
113
173
 
114
- - Improved documentation and added comprehensive comments throughout Betterlog
115
- modules
116
- - Updated Ruby version from **3.4.1** to **3.4.5** in tool versions
117
- configuration
118
- - Removed metric deprecation warning.
174
+ ### Documentation
175
+ - Added comprehensive comments to `Betterlog` module and
176
+ `GlobalMetadata` class methods, including `add`, `remove`, and
177
+ `with_meta`.
178
+ - Documented public and private methods for `Betterlog::Log`, including
179
+ `info`, `warn`, `debug`, `error`, `fatal`, `output`, and `emit`.
180
+ - Added YARD documentation to `Betterlog::Log::Event` methods such as
181
+ `ify`, `parse`, `is?`, `initialize`, `as_json`, `to_json`, `format`,
182
+ `severity`, `emitter`, `notify?`, `eql?`, `hash`, and `compute_data`.
183
+ - Included documentation for `Betterlog::Log::EventFormatter` methods,
184
+ including `initialize`, `format`, `colorize`, `apply_style`,
185
+ `format_pattern`, and `format_object`.
186
+ - Documented `Betterlog::Log::LegacyEventFormatter` and
187
+ `Betterlog::Log::Severity` classes, covering their constructors,
188
+ conversion methods, and comparison logic.
189
+ - Added class-level and method documentation to
190
+ `Betterlog::Notifiers`, including `register`, `notify`, and
191
+ `context`.
192
+ - Documented the `Betterlog::Railtie` integration and the `Log`
193
+ convenience alias class in `lib/betterlog.rb`.
194
+
195
+ ### Build & CI
196
+ - Updated `gem_hadar` development dependency constraint from `~> 1.19`
197
+ to `~> 1.28`.
198
+ - Replaced direct `simplecov` configuration in `spec/spec_helper.rb`
199
+ with `gem_hadar/simplecov` initialization.
200
+ - Updated the Ruby version in `.tool-versions` from **3.4.1** to
201
+ **3.4.5**.
119
202
 
120
203
  ## 2025-02-19 v2.0.6
121
204
 
122
- - Added `licenses` attribute to GemHadar in Rakefile
205
+ ### Build & CI
206
+ - Added `Apache-2.0` license metadata to the `Rakefile` and
207
+ `betterlog.gemspec` for RubyGems packaging.
123
208
 
124
209
  ## 2025-02-13 v2.0.5
125
210
 
126
- - Removed `gem update --system` command from Dockerfile to prevent version
127
- changes
128
- - Added `yaml-dev` package to `build-base` installation in Dockerfile
129
- - Updated `gem install gem_hadar` command in Dockerfile to run without bundler
130
- - Added support for Ruby versions **3.4** and **3.3** with new Docker image
131
- configurations
132
- - Updated `.tool-versions` file to use Ruby version **3.4.1** and removed
133
- **2.3.17**
211
+ ### Improvements
212
+ - Add support for Ruby **3.3** and **3.4** in CI configurations
213
+ by adding `ruby:3.3-alpine` and `ruby:3.4-alpine` images.
214
+
215
+ ### Build & CI
216
+ - Update `.tool-versions` to use Ruby **3.4.1** and remove the
217
+ `bundler` version pinning.
218
+ - Update Dockerfile to install `yaml-dev` and `gem_hadar`, while
219
+ removing the `gem update --system` step and `bundler` installation.
134
220
 
135
221
  ## 2024-03-13 v2.0.4
136
222
 
137
- - Improved the legacy event formatter implementation
138
- - Updated code to use the new name for the legacy event formatter
223
+ ### Improvements
224
+ - Improved the legacy event formatter by updating its reference to use
225
+ the renamed `Betterlog::Log::LegacyEventFormatter` class.
226
+
227
+ ### Testing
228
+ - Renamed the event formatter spec file to
229
+ `spec/betterlog/log/legacy_event_formatter_spec.rb` to align with the
230
+ updated module structure.
139
231
 
140
232
  ## 2024-03-13 v2.0.3
141
233
 
142
- - Added global metadata support to the legacy emitter
143
- - Renamed and moved the legacy formatter/emitter components
144
- - Removed the passing of context to blocks in the code
234
+ ### Breaking
235
+ - `GlobalMetadata.with_meta` no longer passes a frozen context object to the
236
+ block; the block must now rely on `GlobalMetadata.current` to access the
237
+ active metadata.
238
+
239
+ ### Features
240
+ - The legacy event emitter now includes global metadata from
241
+ `GlobalMetadata` instead of manually reading `Sidekiq::Context`.
242
+
243
+ ### Improvements
244
+ - Renamed `LogEventFormatter` to `LegacyEventFormatter` and moved it to
245
+ `lib/betterlog/log/legacy_event_formatter.rb` for better namespace
246
+ organization.
145
247
 
146
248
  ## 2024-01-25 v2.0.2
147
249
 
148
- - Removed the passing of context to block in the codebase
149
- - Eliminated unnecessary context parameter handling in block execution flow
250
+ ### Breaking
251
+ - Removed the metadata context hash argument from the block passed to
252
+ `with_meta` in `Betterlog::GlobalMetadata`.
253
+
254
+ ### Testing
255
+ - Updated `spec/betterlog/global_metadata_spec.rb` to remove assertions
256
+ for the removed block argument.
150
257
 
151
258
  ## 2023-08-17 v2.0.1
152
259
 
153
- - Renamed `with_metadata` method to `with_meta`
154
- - Added new `Betterlog.with_meth` convenience method
155
- - Updated method names to improve clarity and consistency in logging
156
- functionality
260
+ ### Breaking
261
+ - Renamed `Betterlog::GlobalMetadata.with_context`
262
+ to `Betterlog::GlobalMetadata.with_meta`.
263
+
264
+ ### Features
265
+ - Added `Betterlog.with_meta` as a convenience method
266
+ for managing global metadata.
267
+
268
+ ### Testing
269
+ - Updated global metadata specs to use the renamed
270
+ `with_meta` method.
271
+ - Added tests to verify the new `Betterlog.with_meta`
272
+ shortcut method.
157
273
 
158
274
  ## 2023-08-17 v2.0.0
159
275
 
160
- - Removed obsolete metric support with warning implementation
161
- - Simplified code significantly
162
- - Added support for `Betterlog::GlobalMetadata` via block form of
163
- `with_context` method
164
- - Updated `with_context` method to handle context variable removal properly
165
- - Changed behavior to warn about removed metric support instead of maintaining
166
- it
276
+ ### Breaking
277
+ - Removed support for `Log#metric`, which now emits a deprecation warning.
278
+ - Replaced `Log#context` with the `Betterlog::GlobalMetadata#with_context` block form for automatic context cleanup.
279
+ - Changed the interface of `Betterlog::Notifiers.notify` to accept a message and event data.
280
+
281
+ ### Features
282
+ - Added `Betterlog::GlobalMetadata#remove` to clear specific keys from the global context.
283
+ - Added `Betterlog::GlobalMetadata#with_context` to manage context variables within a block.
284
+
285
+ ### Improvements
286
+ - Simplified `Log::Event.ify` to use keyword arguments and consistent data handling.
287
+ - Updated `Betterlog::GlobalMetadata` to store data in a thread-local `current` hash.
288
+ - Refactored `Log` methods to merge severity into the event data consistently.
289
+ - Updated `Log::Event` to nest global metadata and Sidekiq context under a `meta` key.
290
+
291
+ ### Build & CI
292
+ - Added `all_images` configuration for testing against Ruby **3.1** and **3.2** Alpine images.
293
+ - Added `debug` and `all_images` as development dependencies in the Rakefile and gemspec.
294
+
295
+ ### Testing
296
+ - Added test coverage for `Betterlog::GlobalMetadata` add, remove, and with_context behaviors.
297
+ - Updated log event specs to verify metadata inclusion in notification payloads.
298
+ - Replaced `byebug` with `debug` in the test helper.
167
299
 
168
300
  ## 2023-08-16 v1.1.1
169
301
 
170
- - Added Sidekiq context to metadata of regularly emitted events
171
- - Enhanced event metadata with Sidekiq information for better tracking and
172
- debugging capabilities
302
+ ### Features
303
+ - Include `Sidekiq::Context.current` in the `meta` data for events emitted by the library.
173
304
 
174
305
  ## 2023-02-10 v1.1.0
175
306
 
176
- - Added context of Sidekiq logger to legacy emitter output
177
- - Enhanced logging capabilities by incorporating Sidekiq context information
178
- - Improved debugging and monitoring of legacy emitter functionality
179
- - Updated logging infrastructure to support Sidekiq integration
180
- - Modified emitter output format to include additional contextual information
307
+ ### Features
308
+ - Include `Sidekiq::Context.current` metadata in legacy log event
309
+ output when `Sidekiq` is defined.
310
+ - Symbolize keys recursively in `GlobalMetadata#add` data hash.
181
311
 
182
312
  ## 2023-01-30 v1.0.0
183
313
 
184
- - Removed the `log_pusher` functionality from the codebase
185
- - Eliminated the associated logging mechanism that was previously used for
186
- pushing logs
314
+ ### Breaking
315
+ - Removed `betterlog_pusher` and `betterlog_sink` executables.
316
+ - Removed the `Betterlog::Logger` class and its `redis` runtime dependency.
317
+
318
+ ### Build & CI
319
+ - Removed the Go build toolchain, `Dockerfile`, and associated CI tasks.
320
+ - Updated gem metadata to reflect the removal of `redis` and `mock_redis` dependencies.
187
321
 
188
322
  ## 2022-08-18 v0.20.3
189
323
 
190
- - Added example code to demonstrate usage
191
- - Updated build configuration to use Go version **1.17**
192
- - Upgraded base image to Alpine **3.14.3**
193
- - Removed deprecated `cloudbuild.yaml` file
194
- - Implemented proper loading of version specification
195
- - Configured CodeQL analysis workflow
196
- - Reverted previous message-related changes
197
- - Built project from scratch with updated dependencies
198
- - Updated build system and tooling configurations
324
+ ### Breaking
325
+ - The Docker image now runs the `betterlog-server` binary directly from the
326
+ root directory and no longer uses `go-init` as the entrypoint.
327
+
328
+ ### Features
329
+ - Added a CodeQL analysis workflow to scan Go and Ruby code on pushes,
330
+ pull requests, and a weekly schedule.
331
+
332
+ ### Improvements
333
+ - Refactored the Dockerfile to use a `golang:1.18-alpine` base image,
334
+ enabling a scratch-based final image for reduced size and security
335
+ surface.
336
+ - Upgraded the Go toolchain to version **1.19** and updated dependencies,
337
+ including `github.com/labstack/echo/v4` to version **4.8.0**.
338
+ - Updated `.tool-versions` to specify Ruby **3.1.2** and Golang **1.19**.
339
+
340
+ ### Build & CI
341
+ - Removed the `cloudbuild.yaml` configuration file, replacing the previous
342
+ build pipeline with the new Docker and GitHub Actions setup.
343
+ - Updated the development dependency on `gem_hadar` to version **1.12.0**.
344
+
345
+ ### Testing
346
+ - Refactored `global_metadata_spec.rb` to use a named `FakeNotifierClass`
347
+ instead of an anonymous class.
348
+ - Added a version spec to ensure `Betterlog::VERSION` is a valid string.
349
+
350
+ ### Documentation
351
+ - Added usage examples for matching specific events and metadata in the
352
+ `bin/betterlog` help text.
199
353
 
200
354
  ## 2021-10-28 v0.20.2
201
355
 
202
- - Reverted previous changes that modified the behavior of passing arguments
203
- - Changed implementation to rely on the originally passed argument instead of
204
- alternative approaches
205
- - Removed modifications that had been previously introduced for argument
206
- handling
356
+ ### Fixes
357
+ - Reverted a change in `LogEventFormatter#call` that
358
+ incorrectly overwrote the `message` argument with the result of
359
+ `super.to_s`.
207
360
 
208
361
  ## 2021-10-28 v0.20.1
209
362
 
210
- - Fixed backtrace parsing logic to handle edge cases properly
211
- - Corrected backtrace parsing implementation for more reliable error reporting
212
- - Improved backtrace parsing to work correctly with **Ruby** version **3.1**+
213
- error messages
214
- - Enhanced backtrace parsing to properly extract method names and file
215
- locations from stack traces
363
+ ### Fixes
364
+ - Corrected the regex used by `log_event_formatter.rb` to properly
365
+ parse backtrace lines from log messages.
216
366
 
217
367
  ## 2021-10-26 v0.20.0
218
368
 
219
- - Modified message coloring behavior to remove colors from JSON output
220
- - Updated test execution to continue running tests even when push operations
221
- fail
369
+ ### Features
370
+ - Strip ANSI color codes from non-event log messages before
371
+ serialization to ensure clean JSON output.
372
+
373
+ ### Fixes
374
+ - Set the `message` attribute to the first line of the backtrace
375
+ instead of a static string when logging multi-line backtraces.
376
+
377
+ ### Build & CI
378
+ - Update the CI environment from `ubuntu1804` to `ubuntu2004`.
379
+ - Dynamically determine the Ruby version from `.tool-versions`
380
+ in CI pipelines instead of using a hardcoded version.
381
+ - Prevent CI build failures by allowing the image push step to
382
+ exit successfully even if the push command fails.
383
+
384
+ ### Testing
385
+ - Add `spec/betterlog/log_event_formatter_spec.rb` to cover
386
+ message uncoloring, blank message handling, and backtrace
387
+ deconstruction.
222
388
 
223
389
  ## 2021-09-21 v0.19.0
224
390
 
225
- - Upgraded Ruby version to **3.0.2**
226
- - Upgraded labstack/echo to specific v4 version
227
- - Upgraded Alpine Linux to version **3.14.2**
228
- - Upgraded Alpine Linux to version **3.14.1**
229
- - Upgraded Alpine Linux to version **3.14**
230
- - Upgraded Alpine Linux to version **3.13.5**
231
- - Upgraded Alpine Linux to version **3.13.4**
232
- - Implemented git SHA tagging for master commits
391
+ ### Fixes
392
+ - Updated `Log::Event.ify` call in specs to pass an explicit hash
393
+ literal to ensure Ruby 3 compatibility.
394
+
395
+ ### Improvements
396
+ - Upgraded the `labstack/echo` dependency from version **v3** to
397
+ **v4**.
398
+ - Upgraded the base Docker image to `alpine:3.14.2`.
399
+
400
+ ### Build & CI
401
+ - Added `.tool-versions` to specify Go `1.16` and Ruby `3.0.2`.
402
+ - Configured the Semaphore CI pipeline to push the latest image
403
+ for `master` branch commits instead of tagged releases only.
404
+ - Updated `docker build` commands in the Makefile to include the
405
+ `--pull` flag.
233
406
 
234
407
  ## 2021-03-05 v0.18.0
235
408
 
236
- - Fixed compatibility issue with **Ruby 3.0**
237
- - Updated version tag
409
+ ### Fixes
410
+ - Fixed `format` method in `lib/betterlog/log/event.rb` to
411
+ use keyword arguments for Ruby **3.0** compatibility.
238
412
 
239
413
  ## 2021-03-01 v0.17.0
240
414
 
241
- - Updated base image to **alpine 3.13.2**
415
+ ### Build & CI
416
+ - Updated the base image from `alpine:3.13.1` to `alpine:3.13.2`.
242
417
 
243
418
  ## 2021-02-10 v0.16.0
244
419
 
245
- - Added check for tag name in the codebase
246
- - Upgraded base system to Alpine version **3.13.1**
420
+ ### Build & CI
421
+ - Check `$SEMAPHORE_GIT_TAG_NAME` instead of branch to trigger
422
+ `push-latest` in the Semaphore CI pipeline.
423
+ - Upgrade the base image from `alpine:3.12.3` to `alpine:3.13.1` in
424
+ the `Dockerfile`.
247
425
 
248
426
  ## 2021-02-03 v0.15.2
249
427
 
250
- - Handle invalid UTF-8 characters in log messages
251
- - Add bx configuration
252
- - Add path configuration
253
- - Pass registry name being used
254
- - Upgrade dependencies
255
- - Base image on alpine:**3.12.3**
256
- - Only push on master branch builds
428
+ ### Fixes
429
+ - Handle invalid UTF-8 characters in log messages by sanitizing them to
430
+ prevent serialization errors in `Log::Event#to_json`.
431
+ - Replace `Event#to_json` with `JSON.generate` in `Log`,
432
+ `LogEventFormatter`, and `EventFormatter` for consistent and safe
433
+ serialization of event data.
434
+
435
+ ### Build & CI
436
+ - Configure Bundler to install gems into the `vendor/bundle` path in CI.
437
+ - Update Docker base image from **3.12.1** to **3.12.3**.
438
+ - Push Docker images to the `eu.gcr.io` registry.
439
+ - Restrict Docker image pushes to the `master` branch.
440
+ - Execute RSpec tests using `bundle exec` in CI.
257
441
 
258
442
  ## 2020-12-07 v0.15.1
259
443
 
260
- - Move testing configuration to Semaphore CI environment
261
- - Improve search syntax implementation
444
+ ### Improvements
445
+ - Updated the search logic in `bin/betterlog` to support
446
+ nested key-value matching and direct string inclusion.
447
+
448
+ ### Build & CI
449
+ - Migrated the continuous integration pipeline from Travis CI
450
+ to Semaphore.
262
451
 
263
452
  ## 2020-11-02 v0.15.0
264
453
 
265
- - Added test configuration for Semaphore CI platform
266
- - Updated continuous integration setup to include Semaphore testing environment
267
- - Configured build pipeline to run tests on Semaphore infrastructure
268
- - Integrated Semaphore-specific test execution settings
454
+ ### Breaking
455
+ - Removed the `Redis` dependency from the `Rakefile` and replaced
456
+ it with `mock_redis` in development and testing environments.
457
+
458
+ ### Improvements
459
+ - Refactored library loading to require `logger`, `time`, and
460
+ `term/ansicolor` within specific modules rather than globally.
461
+ - Updated `Dockerfile` to use `alpine:3.12.1` and renamed the
462
+ `fetch` make target to `setup`.
463
+
464
+ ### Build & CI
465
+ - Migrated CI infrastructure from Travis CI to Semaphore,
466
+ removing `.travis.yml` and adding `.semaphore/semaphore.yml`.
467
+ - Added `mock_redis` as a development dependency in the
468
+ gemspec.
469
+
470
+ ### Testing
471
+ - Configured `mock_redis` in `spec/spec_helper.rb` to
472
+ replace the global `Redis` constant during tests.
269
473
 
270
474
  ## 2020-08-26 v0.14.1
271
475
 
272
- - Allow log file to be missing during loading process
273
- - Handle cases where log file may not exist when loading configuration
476
+ ### Fixes
477
+ - Prevent errors during initialization if the log file is missing by
478
+ using safe navigation to check the log level.
274
479
 
275
480
  ## 2020-07-30 v0.14.0
276
481
 
277
- - Fixed regexp encoding match problem
278
- - Made log level easily configurable
482
+ ### Breaking
483
+ - The `logger` method in `Betterlog::Log` now delegates to `default_logger`
484
+ instead of instantiating a new `::Logger` instance, which may change
485
+ behavior for custom configurations.
486
+
487
+ ### Fixes
488
+ - Fix a regexp encoding mismatch in `Betterlog::Logger#each` by
489
+ forcing the buffer and regex to `ASCII-8BIT` encoding.
490
+ - Force encoding to `ASCII-8BIT` on Redis string ranges in
491
+ `Betterlog::Logger#each_chunk` to prevent encoding errors.
492
+
493
+ ### Improvements
494
+ - Make log level configurable via `ComplexConfig` for both
495
+ `Betterlog::Logger` and `Betterlog::Log`.
279
496
 
280
497
  ## 2020-07-20 v0.13.1
281
498
 
282
- - Replace existence check with boolean method
283
- - Upgrade base image to Alpine **3.12.0**
499
+ ### Fixes
500
+ - Replace the deprecated `exists` method with `exists?` for Redis
501
+ key lookups.
502
+
503
+ ### Build & CI
504
+ - Upgrade the Docker base image to **3.12.0** from **3.11.6**.
284
505
 
285
506
  ## 2020-05-12 v0.13.0
286
507
 
287
- - Updated base image to **alpine 3.11.6**
288
- - Modified `kubectl` config name in `betterlog_sink` to use `cluster.name` from
289
- configuration instead of hardcoded value
508
+ ### Features
509
+ - Use `cluster.name` from config for the `kubectl`
510
+ config name in `betterlog_sink`.
511
+
512
+ ### Build & CI
513
+ - Base the Docker image on `alpine:3.11.6` and remove the
514
+ `BASE_IMAGE` build argument.
290
515
 
291
516
  ## 2020-04-20 v0.12.2
292
517
 
293
- - Added support for using `as_json` method for automatic serialization
294
- - Enabled automatic serialization functionality when `as_json` is present
518
+ ### Features
519
+ - Rename `as_hash` to `as_json` on `Betterlog::Log::Event` to
520
+ indicate serialization intent, and update `to_json` to use the new
521
+ method.
522
+ - Update `emit` in `Betterlog::Log` to use `as_json` instead of
523
+ `as_hash` when constructing error context.
524
+ - Update `Betterlog::Notifiers` to pass `as_json` to registered
525
+ notifiers.
526
+ - Make `emit` a public method on `Betterlog::Log` to allow external
527
+ callers to trigger event emission.
528
+
529
+ ### Documentation
530
+ - Update spec for `Betterlog::Log::Event` to test the renamed
531
+ `as_json` method.
295
532
 
296
533
  ## 2020-04-02 v0.12.1
297
534
 
298
- - Updated output handling to include **false** values in addition to previously
299
- handled values
300
- - Modified the output logic to ensure boolean **false** is properly processed
301
- and displayed
535
+ ### Fixes
536
+ - Ensure that `false` values are correctly formatted in the event
537
+ formatter output.
302
538
 
303
539
  ## 2020-04-02 v0.12.0
304
540
 
305
- - Added ability to evaluate block results and log with metric
306
- - Implemented new functionality for block result evaluation
307
- - Enhanced logging capabilities with metric support
308
- - Updated code to support metric-based logging of block evaluations
309
- - Modified evaluation logic to incorporate metric tracking
310
- - Added logging infrastructure for block result metrics
311
- - Improved block evaluation reporting with metric integration
541
+ ### Features
542
+ - Add optional `success` parameter to `metric`, allowing callers to
543
+ evaluate block results and conditionally log success status.
544
+ - Modify `metric` to capture block results and pass them to the success
545
+ block when building the event.
546
+
547
+ ### Fixes
548
+ - Update specs to include `success` in expected events, ensuring default
549
+ behavior is tested and custom success blocks validate correctly.
312
550
 
313
551
  ## 2020-04-02 v0.11.0
314
552
 
315
- - Simplified the interface by refactoring code structure
316
- - Improved CLI command implementation for better usability
317
- - Updated build configuration to target Alpine Linux version **3.11.5**
318
- - Switched to using `better-builder` for enhanced build capabilities
553
+ ### Breaking
554
+ - Removed the `measure` method from `Log`, which was merged into
555
+ `metric`.
556
+ - Updated the `metric` method to accept a block for timing, replacing
557
+ the previous `measure` implementation.
558
+ - The `metric` method now sets `duration` in the event if a block was
559
+ provided.
560
+ - Changed `time_block` to accept an optional block, returning
561
+ immediately if no block is given.
562
+
563
+ ### Features
564
+ - Added support for multiple `-s` search strings in the CLI, allowing
565
+ users to filter events by multiple conditions simultaneously.
566
+ - Added support for JSON output format via `-p json` or `-p j` flags in
567
+ the CLI.
568
+
569
+ ### Improvements
570
+ - Refactored the `metric` method to handle both static values and timed
571
+ blocks, simplifying the interface.
572
+ - Updated the CLI help text to reflect that the `-s` flag can be
573
+ repeated.
574
+
575
+ ### Build & CI
576
+ - Updated `go.mod` to use Go **1.14** and bumped `go-redis/redis` to
577
+ **v6.15.7+incompatible**.
578
+ - Replaced the Docker builder in `cloudbuild.yaml` with
579
+ `eu.gcr.io/betterplace-183212/better-builder`.
580
+
581
+ ### Testing
582
+ - Merged `#measure` and `#metric` test cases into a single `#metric`
583
+ block.
584
+ - Updated existing timing tests to use `metric` instead of `measure`.
319
585
 
320
586
  ## 2020-01-22 v0.10.0
321
587
 
322
- - Handle intermittent redis failover events with liberal logging to a fallback
323
- logger
324
- - Fallback to a standard stderr logger when redis has connection problems,
325
- particularly during failover events
326
- - Mute output and use expect instead for improved behavior
327
- - Improve output formatting
328
- - Add support for testing on Ruby **2.7**
329
- - Include Redis failover fixes
330
- - Add `cloudbuild.yaml` configuration file
588
+ ### Features
589
+ - Fall back to a standard stderr logger if Redis has connection
590
+ problems during failover events.
591
+ - Handle intermittent Redis failover events by cleaning up temporary
592
+ keys and logging errors to the fallback logger.
593
+
594
+ ### Fixes
595
+ - Correctly log the warning about reaching the Redis memory limit to
596
+ the fallback logger instead of appending it to Redis.
597
+ - Ensure temporary Redis keys are deleted if the `each_chunk` process
598
+ is interrupted or fails, preventing stale key accumulation.
599
+
600
+ ### Improvements
601
+ - Update the `betterlog_pusher` output format to display a cleaner
602
+ progress indicator and completion message.
603
+
604
+ ### Build & CI
605
+ - Add `cloudbuild.yaml` for Cloud Build integration and update the
606
+ Makefile to use Alpine 3.13.3 as the base image.
607
+ - Update the gemspec to include the new `cloudbuild.yaml` file in the
608
+ package.
609
+
610
+ ### Testing
611
+ - Add tests for the Redis failover fallback behavior in both `<<` and
612
+ `add` methods.
613
+ - Update `log_spec` to mute specific logger output and expect standard
614
+ logger interactions.
615
+ - Add Ruby **2.7** to the Travis CI test matrix.
331
616
 
332
617
  ## 2020-01-17 v0.9.0
333
618
 
334
- - Added support for using sentinel configuration for high availability Redis
335
- setups
336
- - Included `error_class` in the pl (package list) command output format
619
+ ### Features
620
+ - Use Redis Sentinel support in `bin/betterlog_pusher` when the
621
+ `REDIS_SENTINELS` environment variable is set.
622
+ - Include the `error_class` variable in the plain output format defined
623
+ in `config/log.yml`.
624
+
625
+ ### Build & CI
626
+ - Bumped the `redis` gem dependency requirement to **2.8**.
337
627
 
338
628
  ## 2019-11-15 v0.8.1
339
629
 
340
- - Fixed the output format of metrics in the `Metric` class
341
- - Repurposed the `type` attribute to function as a metric identifier across all
342
- metrics
343
- - Updated metric handling to use `metric` as the primary classification instead
344
- of `type`
630
+ ### Breaking
631
+ - Removed the `type:` keyword argument from `metric` and `measure`,
632
+ as the metric type is now automatically set to `metric` and the
633
+ specific type is expected to be part of the metric `name`.
634
+
635
+ ### Fixes
636
+ - Corrected the output of metrics by removing the `type` placeholder
637
+ from the default metric format in `config/log.yml`.
638
+
639
+ ### Improvements
640
+ - Updated `build_metric` to set a default severity of `info` instead of
641
+ `debug`.
642
+ - Changed the default metric message format in `build_metric` to
643
+ display the metric name and value pair, e.g., `a metric
644
+ name=value`.
645
+
646
+ ### Testing
647
+ - Updated unit tests in `spec/betterlog/log_spec.rb` to reflect the
648
+ removal of the `type:` argument and the updated event structure.
345
649
 
346
650
  ## 2019-11-15 v0.8.0
347
651
 
348
- - Changed the keyword arguments and semantics of the `Log.metric` method
349
- - Updated the `Log.metric` method to support new parameter handling
350
- - Modified how metric data is processed and stored within the logging system
351
- - Adjusted internal logic for metric collection and reporting
352
- - Enhanced flexibility in how metrics are configured and used throughout the
353
- application
652
+ ### Breaking
653
+ - Renamed `metric` keyword argument to `name` in `Log#metric`,
654
+ `Log#measure`, and `Log#build_metric`.
655
+ - Changed default metric `type` for `Log#measure` from `seconds`
656
+ to `duration`.
657
+ - Modified `Log#logger` to check `Rails.respond_to?(:logger)`
658
+ before accessing `Rails.logger`.
659
+
660
+ ### Improvements
661
+ - Expanded documentation for `Log#metric` to clarify the usage
662
+ and structure of the `name`, `type`, and `value` parameters.
354
663
 
355
664
  ## 2019-11-06 v0.7.2
356
665
 
357
- - Prevented honeybadger notifier from modifying its argument, which caused
358
- circular reference issues
359
- - Removed original hash from being passed to honeybadger as it corrupts the
360
- data structure
361
- - Fixed circular reference problem in honeybadger integration by avoiding
362
- modification of notifier arguments
363
- - Ensured honeybadger does not ruin the original hash by not passing it through
364
- - Addressed issue where honeybadger was modifying its input argument causing
365
- unexpected behavior
666
+ ### Fixes
667
+ - Return a dup of `@data` in `Betterlog::Log::Event#as_hash` to
668
+ prevent Honeybadger from mutating the original hash.
669
+
670
+ ### Testing
671
+ - Add a spec verifying that `Betterlog::Log::Event#as_hash` returns
672
+ a new hash object rather than the internal instance variable.
366
673
 
367
674
  ## 2019-11-01 v0.7.1
368
675
 
369
- - Fixed casing issues in the codebase
370
- - Updated version number to **1.5.0**
676
+ ### Fixes
677
+ - Corrected the casing of log severity names to lowercase and updated
678
+ serialization output.
679
+ - Modified `Severity#as_json` to return the string representation,
680
+ ensuring uppercase log levels.
681
+ - Updated the default unknown severity name to `:unknown`.
371
682
 
372
683
  ## 2019-10-31 v0.7.0
373
684
 
374
- - Allow configuration using `redis_url` directly by catching
375
- `Redis::CannotConnectError` to prevent application crashes and disable
376
- logging instead
377
- - Implement flyweight pattern on `Betterlog::Log::Severity` constant wrapper
378
- for improved performance
379
- - Add test for circular regression with repeated immediate objects
380
- - Use `tins symbolize_keys_recursive` to handle circular data structures
381
- - Fix clobbering of repeated scalar values in configuration
382
- - Switch to using `go mod` for package management
383
- - Add server and clients for logging functionality
685
+ ### Features
686
+ - Added `for_redis_url` class method to `Betterlog::Logger` to
687
+ initialize a logger from a Redis URL, returning `nil` if the
688
+ connection fails.
689
+ - Replaced custom circular reference detection in
690
+ `Betterlog::Log::Event` with `tins`
691
+ `symbolize_keys_recursive` using the `circular` option.
692
+
693
+ ### Fixes
694
+ - Corrected `Betterlog::Log::Severity` to use uppercase symbols and
695
+ implement the flyweight pattern for constant instances.
696
+ - Fixed `Betterlog::Log::Severity` comparison logic to properly
697
+ handle comparisons with non-`Severity` objects.
698
+ - Resolved issue in `Betterlog::Log::Event` serialization where
699
+ repeated scalar values were incorrectly flagged as circular.
700
+
701
+ ### Improvements
702
+ - Switched Go module management to `go mod` in the `Makefile` and
703
+ added `go.mod` and `go.sum` files.
704
+
705
+ ### Testing
706
+ - Added `spec/betterlog/log/severity_spec.rb` to test
707
+ `Betterlog::Log::Severity` behavior.
708
+ - Expanded `spec/betterlog/log/event_spec.rb` to cover circular hash
709
+ handling and repeated scalar serialization.
710
+ - Added tests for `Betterlog::Logger.for_redis_url` connection
711
+ handling in `spec/betterlog/logger_spec.rb`.
712
+
713
+ ### Build & CI
714
+ - Updated `tins` dependency requirement to `>= 1.22.0`.
384
715
 
385
716
  ## 2019-07-22 v0.6.1
386
717
 
387
- - Made `maximum buffer_size` configurable through a new configuration option
388
- - Added ability to customize the buffer size limit for data processing
389
- operations
718
+ ### Features
719
+ - Added configurable `buffer_size` option to `Betterlog::Logger`,
720
+ which is now clamped between 1 MB and 511 MB.
390
721
 
391
722
  ## 2019-07-18 v0.6.0
392
723
 
393
- - Updated implementation to actually perform the actions previously only
394
- announced
395
- - Fixed discrepancy between declared functionality and actual code behavior
396
- - Ensured proper execution of intended operations in the codebase
724
+ ### Fixes
725
+
726
+ - Removed immediate exit on `Redlock::LockError` in `bin/betterlog_pusher` to
727
+ allow the retry loop to continue.
397
728
 
398
729
  ## 2019-07-18 v0.5.0
399
730
 
400
- - Fixed implementation to actually perform the intended behavior as announced
401
- in previous commit
402
- - Corrected logic to properly handle the expected functionality for **v3.5.0**
403
- release
731
+ ### Fixes
732
+ - Removed the call to `exit` in `bin/betterlog_pusher` when
733
+ catching `Redlock::LockError` so the loop continues retrying
404
734
 
405
735
  ## 2019-07-17 v0.4.0
406
736
 
407
- - Added lock mechanism to `betterlog_pusher` to ensure the task runs only once,
408
- preventing issues during scalingo deployments where the task might start
409
- multiple times simultaneously
410
- - Improved test specifications
411
- - Added configuration hints for better user guidance
412
- - Updated example `log.yml` configuration file
413
- - Enhanced documentation with additional information
737
+ ### Improvements
738
+ - Added `Redlock` support to `betterlog_pusher` to ensure the task runs
739
+ only once.
740
+ - Added `host` to the default log format and metadata in `config/log.yml`.
741
+ - Updated staging and production log configurations in `config/log.yml` to
742
+ include specific sink and cluster details.
743
+
744
+ ### Documentation
745
+ - Added a new Configuration section to the README with setup instructions.
746
+ - Expanded the README with usage examples for `betterlog` and `betterlog_pusher`.
747
+
748
+ ### Testing
749
+ - Updated `log_spec.rb` to include backtrace data and verify the inspected
750
+ error message format.
414
751
 
415
752
  ## 2019-07-15 v0.3.0
416
753
 
417
- - Added `betterlog_sink` command and sink to path
418
- - Updated dependency to use the newest version of `gem_hadar` **1.0.0**
754
+ ### Features
755
+ - Added the `betterlog_sink` executable. This tool wraps `kubectl logs`
756
+ to retrieve and format logs from the specified Kubernetes
757
+ environment, with support for the `LOG_ENV` variable.
758
+ - Documented the usage of the new `betterlog_sink` command in the
759
+ `README.md`.
760
+
761
+ ### Build & CI
762
+ - Bumped the `gem_hadar` dependency to **~> 1.10.0**.
763
+ - Registered `betterlog_sink` in the `Rakefile` and `betterlog.gemspec`
764
+ to ensure it is included in the package.
419
765
 
420
766
  ## 2019-07-04 v0.2.2
421
767
 
422
- - Added support for providing health page in disabled SSL mode
423
- - Moved some code into separate files to improve organization
424
- - Bumped version number to **0.15.0**
768
+ ### Fixes
769
+ - Serve the health check page when SSL is disabled.
770
+
771
+ ### Improvements
772
+ - Extract the `Config` and `RedisCertCache` types into dedicated
773
+ files within the `betterlog` package.
774
+ - Correct the package declaration in `healthz.go` to `betterlog`.
425
775
 
426
776
  ## 2019-06-27 v0.2.1
427
777
 
428
- - Logger configuration still requires manual setup
429
- - The `Logger` component needs explicit configuration rather than automatic
430
- initialization
431
- - Users must manually configure the logger settings in their applications
778
+ ### Improvements
779
+ - Removed the automatic assignment of `Rails.logger` to a `Betterlog::Logger`
780
+ instance inside the railtie initializer, requiring manual configuration.
432
781
 
433
782
  ## 2019-06-27 v0.2.0
434
783
 
data/README.md CHANGED
@@ -18,6 +18,8 @@ You can also put this line into your Gemfile:
18
18
  and bundle. This will make the `Betterlog` module and its logging facilities
19
19
  available.
20
20
 
21
+ > **Requires Ruby `>= 3.2`.**
22
+
21
23
  ## Usage
22
24
 
23
25
  ### Basic Logging
@@ -70,7 +72,7 @@ $ betterlog -h
70
72
  - `-c` Enable colors during pretty printing
71
73
  - `-f` Follow the log files in real-time
72
74
  - `-h` Display help information
73
- - `-p FORMAT` Pretty print log files (e.g., `long`, `short`)
75
+ - `-p FORMAT` Pretty print log files (e.g., `long`, `legacy`)
74
76
  - `-e EMITTER` Only output events from specific emitters
75
77
  - `-s MATCH` Only display events matching search string
76
78
  - `-S SEVERITY` Only output events with specified severity level
@@ -89,8 +91,7 @@ Search for specific terms in log files:
89
91
  $ betterlog -f -s SELECT
90
92
  ```
91
93
 
92
- This filters out all logging messages where `meta: { module: 'api_v4' }` was
93
- given:
94
+ This shows only events where `meta: { module: 'api_v4' }` was given:
94
95
 
95
96
  ```
96
97
  $ betterlog -f -s meta:module=api_v4
@@ -119,29 +120,32 @@ together to provide structured logging:
119
120
 
120
121
  ```mermaid
121
122
  graph TD
122
- A[Application Code] --> B(Log Interface)
123
+ A[Application Code] --> B[Log Interface]
123
124
  B --> C[Betterlog::Log]
124
125
  C --> D[Event Creation]
125
126
  D --> E[JSON Serialization]
126
- E --> F[Formatting Engine]
127
- F --> G[Output to Logger]
127
+ E --> G[Output to Logger]
128
128
 
129
129
  subgraph "Rails Integration"
130
130
  H[Rails.logger]
131
- I[LegacyFormatter]
132
- J[Structured Logging]
133
- H <---> I
134
- I <---> J
131
+ I[LegacyEventFormatter]
132
+ H <--> I
135
133
  end
136
134
 
137
135
  C --> H
136
+
137
+ subgraph "CLI (betterlog binary)"
138
+ K[betterlog] --> L[EventFormatter]
139
+ L --> M[Colorized / Formatted Terminal Output]
140
+ end
138
141
  ```
139
142
 
140
- **Diagram Explanation**: This shows how the system is structured. Application
141
- code calls the logging interface (`Log.info`), which creates structured events
142
- and processes them through JSON serialization and formatting before outputting
143
- to either Rails' logger or a default logger. The Rails integration section
144
- shows how it seamlessly connects with Rails' existing logging infrastructure.
143
+ **Diagram Explanation**: The library path (top) shows how application code
144
+ calls `Log.info`, which creates a structured event, serializes it to JSON,
145
+ and writes it to the Rails logger or the default logger. The
146
+ `EventFormatter` is **not** in this path — it lives in the CLI subgraph and
147
+ is only used by the `betterlog` binary for pretty-printing log files and
148
+ stdin.
145
149
 
146
150
  ### Logging Flow
147
151
 
@@ -151,22 +155,23 @@ When you call a logging method, the following process occurs:
151
155
  sequenceDiagram
152
156
  participant App as Application
153
157
  participant Log as Betterlog::Log
154
- participant Formatter as EventFormatter
155
- participant Logger as Rails.logger/DefaultLogger
158
+ participant Event as Log::Event
159
+ participant Logger as Rails.logger / DefaultLogger
156
160
 
157
161
  App->>Log: Log.info(message, data)
158
- Log->>Formatter: format(pretty: false)
159
- Formatter->>Formatter: JSON.generate(event)
160
- Formatter->>Logger: logger.info(json_string)
161
- Logger-->>App: Success/Failure
162
+ Log->>Event: Event.ify(object, **rest)
163
+ Event-->>Log: structured event
164
+ Log->>Log: emit(event)
165
+ Log->>Logger: logger.send(severity, JSON.generate(event))
166
+ Logger-->>App: written to log file
162
167
  ```
163
168
 
164
169
  **Diagram Explanation**: This illustrates the complete logging workflow. When
165
- you call `Log.info()`, it goes through the Betterlog::Log (or Log) class, gets
166
- formatted into a structured event with JSON serialization, and finally outputs
167
- to either Rails' logger or the default logger. The process is designed to
168
- maintain structured logging while being compatible with existing Rails logging
169
- systems.
170
+ you call `Log.info()`, the message is converted into a structured `Log::Event`
171
+ via `Event.ify`, then emitted through `JSON.generate` directly to the Rails
172
+ logger (or the default logger). The `EventFormatter` is not part of this
173
+ path — it is a CLI-only concern used by the `betterlog` binary for
174
+ pretty-printing.
170
175
 
171
176
  ### Thread-Local Metadata
172
177
 
@@ -313,11 +318,10 @@ instead of its default logger. The system also includes a
313
318
  `Betterlog::Log::LegacyEventFormatter` that ensures compatibility with existing
314
319
  Rails logging formats.
315
320
 
316
- ## Download
317
-
318
- The homepage of this library is located at
321
+ ## Links
319
322
 
320
- * https://github.com/betterplace/betterlog
323
+ - **Source**: https://github.com/betterplace/betterlog
324
+ - **Documentation**: https://betterplace.github.io/betterlog/
321
325
 
322
326
  ## Author
323
327
 
data/Rakefile CHANGED
@@ -23,6 +23,10 @@ GemHadar do
23
23
  filename 'CHANGES.md'
24
24
  end
25
25
 
26
+ github_workflows(
27
+ 'static.yml' => {}
28
+ )
29
+
26
30
  required_ruby_version '>= 3.2'
27
31
 
28
32
  dependency 'tins', '~>1.47'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.5.1
data/betterlog.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: betterlog 2.5.0 ruby lib
2
+ # stub: betterlog 2.5.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "betterlog".freeze
6
- s.version = "2.5.0".freeze
6
+ s.version = "2.5.1".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -5,7 +5,7 @@
5
5
  # by hand; it is rewritten on every `rake version` invocation.
6
6
  module Betterlog
7
7
  # The current version of the Betterlog gem as a String.
8
- VERSION = '2.5.0'
8
+ VERSION = '2.5.1'
9
9
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
10
10
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
11
11
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betterlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - betterplace Developers