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 +4 -4
- data/CHANGES.md +605 -256
- data/README.md +34 -30
- data/Rakefile +4 -0
- data/VERSION +1 -1
- data/betterlog.gemspec +2 -2
- data/lib/betterlog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad7b5eaa440c602c2ca06da38b75431c28315d220d9f2fe3a2e70f60e76eca03
|
|
4
|
+
data.tar.gz: 3eec6510d36b5b5551a0c05b97f9b5d71b272fcba157ad26d56a51761c5e2621
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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-
|
|
3
|
+
## 2026-11-23 v2.5.1
|
|
4
4
|
|
|
5
5
|
### Improvements
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
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
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
93
|
-
-
|
|
94
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
105
|
-
|
|
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
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
138
|
-
-
|
|
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
|
-
|
|
143
|
-
-
|
|
144
|
-
|
|
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
|
-
|
|
149
|
-
-
|
|
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
|
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
171
|
-
-
|
|
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
|
-
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
-
|
|
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
|
-
|
|
185
|
-
-
|
|
186
|
-
|
|
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
|
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
211
|
-
- Corrected
|
|
212
|
-
|
|
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
|
-
|
|
220
|
-
-
|
|
221
|
-
|
|
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
|
-
|
|
226
|
-
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
- Upgraded
|
|
231
|
-
|
|
232
|
-
-
|
|
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
|
-
|
|
237
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
246
|
-
-
|
|
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
|
-
|
|
251
|
-
-
|
|
252
|
-
|
|
253
|
-
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
261
|
-
-
|
|
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
|
-
|
|
266
|
-
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
|
|
273
|
-
-
|
|
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
|
-
|
|
278
|
-
-
|
|
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
|
-
|
|
283
|
-
-
|
|
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
|
-
|
|
288
|
-
-
|
|
289
|
-
|
|
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
|
-
|
|
294
|
-
-
|
|
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
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
306
|
-
-
|
|
307
|
-
|
|
308
|
-
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
-
|
|
316
|
-
-
|
|
317
|
-
|
|
318
|
-
-
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
-
|
|
330
|
-
|
|
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
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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
|
-
|
|
341
|
-
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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
|
-
|
|
349
|
-
-
|
|
350
|
-
|
|
351
|
-
-
|
|
352
|
-
|
|
353
|
-
|
|
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
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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
|
-
|
|
370
|
-
-
|
|
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
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
-
|
|
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
|
-
|
|
388
|
-
- Added
|
|
389
|
-
|
|
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
|
-
|
|
394
|
-
|
|
395
|
-
-
|
|
396
|
-
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
-
|
|
411
|
-
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
-
|
|
418
|
-
-
|
|
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
|
-
|
|
423
|
-
-
|
|
424
|
-
|
|
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
|
-
|
|
429
|
-
-
|
|
430
|
-
|
|
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`, `
|
|
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
|
|
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
|
|
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 -->
|
|
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[
|
|
132
|
-
|
|
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**:
|
|
141
|
-
|
|
142
|
-
and
|
|
143
|
-
|
|
144
|
-
|
|
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
|
|
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->>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
Logger
|
|
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()`,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
##
|
|
317
|
-
|
|
318
|
-
The homepage of this library is located at
|
|
321
|
+
## Links
|
|
319
322
|
|
|
320
|
-
|
|
323
|
+
- **Source**: https://github.com/betterplace/betterlog
|
|
324
|
+
- **Documentation**: https://betterplace.github.io/betterlog/
|
|
321
325
|
|
|
322
326
|
## Author
|
|
323
327
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.5.
|
|
1
|
+
2.5.1
|
data/betterlog.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: betterlog 2.5.
|
|
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.
|
|
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]
|
data/lib/betterlog/version.rb
CHANGED
|
@@ -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.
|
|
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:
|