legion-data 1.4.19 → 1.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 +3 -1
- data/lib/legion/data/connection.rb +31 -1
- data/lib/legion/data/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: 6508feffe4abc08fc01e58d29be2700bea7e1823ccf04b101cac181556985550
|
|
4
|
+
data.tar.gz: 0f0e5e4e7d890c240c1c8e5bbfc698d8390a9d4a3487e10595ff73c8a1d307d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f0033ac790aa9b5e5750cfd97ad9ad43adaa129a9f5fc5c4094483d9e90141f2b23f318e202f6d1917636df860f53baccbc954404cf5d745f201e956eeca751
|
|
7
|
+
data.tar.gz: 78f5b3bfe6a8dd0747aaf740ceb994b051554a76160ea5e7bfd9d440ce851a9acc7cbf7ad996cce66016806b8f6aae138f691877603920072fa2d71a84daaa63
|
data/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Legion::Data Changelog
|
|
2
2
|
|
|
3
|
-
## [1.
|
|
3
|
+
## [1.5.0] - 2026-03-24
|
|
4
4
|
|
|
5
5
|
### Fixed
|
|
6
|
+
- Slow query warnings now tagged with `[data][slow-query]` instead of bare timestamps
|
|
7
|
+
- SQL log output uses tagged Legion::Logging::Logger for consistent `[data]` prefix
|
|
6
8
|
- Fix Style/SymbolArray in conversations migration
|
|
7
9
|
|
|
8
10
|
## [1.4.18] - 2026-03-23
|
|
@@ -7,6 +7,31 @@ module Legion
|
|
|
7
7
|
module Connection
|
|
8
8
|
ADAPTERS = %i[sqlite mysql2 postgres].freeze
|
|
9
9
|
|
|
10
|
+
# Wraps a tagged Legion::Logging::Logger for Sequel's logger interface.
|
|
11
|
+
# Prefixes warn-level messages with [slow-query] since Sequel uses warn
|
|
12
|
+
# for queries exceeding log_warn_duration.
|
|
13
|
+
class SlowQueryLogger
|
|
14
|
+
def initialize(tagged_logger)
|
|
15
|
+
@tagged = tagged_logger
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def warn(message)
|
|
19
|
+
@tagged.warn("[slow-query] #{message}")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def info(message)
|
|
23
|
+
@tagged.info(message)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def debug(message)
|
|
27
|
+
@tagged.debug(message)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def error(message)
|
|
31
|
+
@tagged.error(message)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
10
35
|
class << self
|
|
11
36
|
attr_accessor :sequel
|
|
12
37
|
|
|
@@ -151,10 +176,15 @@ module Legion
|
|
|
151
176
|
def configure_logging
|
|
152
177
|
return if Legion::Settings[:data][:connection].nil? || Legion::Settings[:data][:connection][:log].nil?
|
|
153
178
|
|
|
154
|
-
@sequel.logger =
|
|
179
|
+
@sequel.logger = build_data_logger
|
|
155
180
|
@sequel.sql_log_level = Legion::Settings[:data][:connection][:sql_log_level]
|
|
156
181
|
@sequel.log_warn_duration = Legion::Settings[:data][:connection][:log_warn_duration]
|
|
157
182
|
end
|
|
183
|
+
|
|
184
|
+
def build_data_logger
|
|
185
|
+
tagged = Legion::Logging::Logger.new(lex: 'data')
|
|
186
|
+
SlowQueryLogger.new(tagged)
|
|
187
|
+
end
|
|
158
188
|
end
|
|
159
189
|
end
|
|
160
190
|
end
|
data/lib/legion/data/version.rb
CHANGED