bp3-core 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +4 -2
- data/lib/bp3/core/system_logs.rb +11 -2
- data/lib/bp3/core/version.rb +1 -1
- metadata +2 -3
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79806b260b17bc4842100c7802cad04174a30f9f36c2f7f7e4f42458d4b4e414
|
|
4
|
+
data.tar.gz: a4d1260efdb7987a6bacb036ae71165612a55c474e72b73ea0c8877ea2c93d02
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2663ec6e12e101bb279ba701ee6d20f84b989f679191dfa6685f74dda2141d85ceeecbc94eb063ebf7fd3cfc503872bed303146b18c8538ce0ea3866e5adcf32
|
|
7
|
+
data.tar.gz: f82eff08e30e02419ee52afab7975ac11c6ffcb291d8c23c2961211e26a5d10311a24d1619e1dc5aa8daa7cfc339270d35ec843baea71071942cfaad563e9f9c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
### Changed
|
|
4
|
+
|
|
5
|
+
## [0.5.0] - 2026-11-02
|
|
6
|
+
|
|
7
|
+
- `Bp3::Core::SystemLogs` writes to the Rails log at the level it was called with, instead of always at
|
|
8
|
+
`debug`. An exception is always written as `error`, whatever the level, and so is a message whose level
|
|
9
|
+
is not a logger level
|
|
10
|
+
|
|
3
11
|
## [0.4.0] - 2026-10-30
|
|
4
12
|
|
|
5
13
|
### Security
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
bp3-core (0.
|
|
4
|
+
bp3-core (0.5.0)
|
|
5
5
|
actionview (~> 8.1)
|
|
6
6
|
activesupport (~> 8.1)
|
|
7
7
|
bp3-request_state (~> 0.1)
|
|
@@ -41,9 +41,10 @@ GEM
|
|
|
41
41
|
ast (2.4.3)
|
|
42
42
|
base64 (0.3.0)
|
|
43
43
|
bigdecimal (4.1.3)
|
|
44
|
-
bp3-request_state (0.1.
|
|
44
|
+
bp3-request_state (0.1.4)
|
|
45
45
|
actionpack (~> 8.1)
|
|
46
46
|
activesupport (~> 8.1)
|
|
47
|
+
ostruct (>= 0.6)
|
|
47
48
|
request_store (>= 1.5.1)
|
|
48
49
|
builder (3.3.0)
|
|
49
50
|
concurrent-ruby (1.3.8)
|
|
@@ -66,6 +67,7 @@ GEM
|
|
|
66
67
|
prism (~> 1.5)
|
|
67
68
|
nokogiri (1.19.4-x86_64-darwin)
|
|
68
69
|
racc (~> 1.4)
|
|
70
|
+
ostruct (0.6.3)
|
|
69
71
|
parallel (2.3.0)
|
|
70
72
|
parser (3.3.13.0)
|
|
71
73
|
ast (~> 2.4.1)
|
data/lib/bp3/core/system_logs.rb
CHANGED
|
@@ -8,6 +8,7 @@ module Bp3
|
|
|
8
8
|
extend ActiveSupport::Concern
|
|
9
9
|
|
|
10
10
|
SYSTEM_LOG_DEFAULTS = { log_to_db: true, log_to_io: true }.freeze
|
|
11
|
+
IO_LEVELS = %w[debug info warn error].freeze
|
|
11
12
|
|
|
12
13
|
mattr_accessor :system_exception_name, :system_log_name
|
|
13
14
|
|
|
@@ -27,7 +28,7 @@ module Bp3
|
|
|
27
28
|
record = nil
|
|
28
29
|
if exception
|
|
29
30
|
if system_log_options[:log_to_io]
|
|
30
|
-
rails_logger.
|
|
31
|
+
rails_logger.error do
|
|
31
32
|
"SystemLogs, #{level}, #{key}, #{exception.message}"
|
|
32
33
|
end
|
|
33
34
|
end
|
|
@@ -35,7 +36,9 @@ module Bp3
|
|
|
35
36
|
end
|
|
36
37
|
return record if (message || '').strip == ''
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
if system_log_options[:log_to_io]
|
|
40
|
+
rails_logger.public_send(io_level(level)) { "SystemLogs, #{level}, #{key}, #{message}" }
|
|
41
|
+
end
|
|
39
42
|
begin
|
|
40
43
|
system_logger.log_message(level:, key:, message:, details:) if system_log_options[:log_to_db]
|
|
41
44
|
rescue StandardError => e
|
|
@@ -68,6 +71,12 @@ module Bp3
|
|
|
68
71
|
log(level: 'exception', key:, exception:, details:, **system_log_options)
|
|
69
72
|
end
|
|
70
73
|
|
|
74
|
+
# The logger method for a log level. Anything that is not a logger level is written as an error.
|
|
75
|
+
# The level can come from data, so it never names a method directly.
|
|
76
|
+
def io_level(level)
|
|
77
|
+
IO_LEVELS.include?(level.to_s) ? level.to_s : 'error'
|
|
78
|
+
end
|
|
79
|
+
|
|
71
80
|
def rails_logger
|
|
72
81
|
return Rails.logger if defined?(Rails)
|
|
73
82
|
|
data/lib/bp3/core/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bp3-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wim den Braven
|
|
@@ -129,7 +129,6 @@ extra_rdoc_files: []
|
|
|
129
129
|
files:
|
|
130
130
|
- ".rspec"
|
|
131
131
|
- ".rubocop.yml"
|
|
132
|
-
- ".ruby-version"
|
|
133
132
|
- ".yardopts"
|
|
134
133
|
- CHANGELOG.md
|
|
135
134
|
- CLAUDE.md
|
|
@@ -178,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
178
177
|
- !ruby/object:Gem::Version
|
|
179
178
|
version: '0'
|
|
180
179
|
requirements: []
|
|
181
|
-
rubygems_version: 4.0.
|
|
180
|
+
rubygems_version: 4.0.23
|
|
182
181
|
specification_version: 4
|
|
183
182
|
summary: bp3-core provides core concerns for BP3 (persuavis/black_phoebe_3).
|
|
184
183
|
test_files: []
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ruby-3.4.6
|