mbeditor 0.4.3 → 0.4.5
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 +13 -0
- data/lib/mbeditor/cable_log_filter.rb +60 -2
- data/lib/mbeditor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75e7d28ba5664e0aeae526a954b2032c040d6ac2f20ed327bef9507a29bc3e21
|
|
4
|
+
data.tar.gz: 34b2ba82856f0fef274049050a55e95a465b9d9bdb7e86e3a2299c30ce0e00c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba333da50a99c900136a52832821b7a2d939f7836b5aa05d2bdaedb259167c3c8a32f7ec3e13e854501c51a7686dd354973b3ff9a299c87af2b0e41cfaa8a649
|
|
7
|
+
data.tar.gz: 9fd083956de7ac0c3443715ba15fe63af069822043ab9e4113b8ab9af4096e5ac582e29d8377cd63f1c681b9fbcca5097dbc7f1d20592f937df6bb208fe91988
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.5] - 2026-04-23
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Suppressed Action Cable websocket request lifecycle noise (`Started/Finished "/cable" [WebSocket] ...`) in development logs via `CableLogFilter`.
|
|
12
|
+
- Added regression coverage to ensure websocket lifecycle request logs stay filtered while regular Action Cable logs continue to pass through.
|
|
13
|
+
|
|
14
|
+
## [0.4.4] - 2026-04-23
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- `CableLogFilter` now preserves Action Cable and Action Pack tagged-logger compatibility by supporting formatter-level `current_tags` access and no-op tag operations for untagged or nil formatters.
|
|
18
|
+
- Added regression coverage for formatter-tag compatibility paths to prevent `current_tags` runtime errors.
|
|
19
|
+
- System test Cuprite driver configuration now applies explicit startup timeout options through `driven_by` to avoid intermittent Ferrum browser bootstrap timeouts in CI.
|
|
20
|
+
|
|
8
21
|
## [0.4.3] - 2026-04-22
|
|
9
22
|
|
|
10
23
|
### Added
|
|
@@ -1,25 +1,78 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'delegate'
|
|
4
|
+
require 'logger'
|
|
5
|
+
|
|
3
6
|
module Mbeditor
|
|
4
7
|
# Wraps the ActionCable logger and suppresses all log lines that mention
|
|
5
8
|
# Mbeditor channels so the development console stays readable.
|
|
6
9
|
# Non-Mbeditor ActionCable messages pass through unchanged.
|
|
7
10
|
class CableLogFilter < SimpleDelegator
|
|
8
11
|
SUPPRESS_PATTERN = /Mbeditor::|mbeditor_editor/
|
|
12
|
+
CABLE_WEBSOCKET_REQUEST_PATTERN = /(?:Started|Finished) "\/cable(?:\/[^\"]*)?" \[WebSocket\]/
|
|
13
|
+
|
|
14
|
+
# Provides no-op tagged logging APIs for plain Ruby formatters.
|
|
15
|
+
class UntaggedFormatter < SimpleDelegator
|
|
16
|
+
def tagged(*_tags)
|
|
17
|
+
return yield self if block_given?
|
|
18
|
+
|
|
19
|
+
self
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def current_tags
|
|
23
|
+
[]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def push_tags(*tags)
|
|
27
|
+
tags
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def pop_tags(_count = 1)
|
|
31
|
+
[]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def clear_tags!
|
|
35
|
+
nil
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def formatter
|
|
40
|
+
underlying_formatter = resolve_formatter
|
|
41
|
+
|
|
42
|
+
return underlying_formatter if underlying_formatter.respond_to?(:current_tags)
|
|
43
|
+
|
|
44
|
+
if defined?(@untagged_formatter_source) && @untagged_formatter_source.equal?(underlying_formatter)
|
|
45
|
+
return @untagged_formatter
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
@untagged_formatter_source = underlying_formatter
|
|
49
|
+
@untagged_formatter = UntaggedFormatter.new(underlying_formatter)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def resolve_formatter
|
|
53
|
+
return Logger::Formatter.new unless __getobj__.respond_to?(:formatter)
|
|
54
|
+
|
|
55
|
+
__getobj__.formatter || Logger::Formatter.new
|
|
56
|
+
end
|
|
9
57
|
|
|
10
58
|
%w[debug info warn error fatal unknown].each do |level|
|
|
11
59
|
define_method(level) do |message = nil, &block|
|
|
12
60
|
msg = message.nil? && block ? block.call : message.to_s
|
|
13
|
-
return if
|
|
61
|
+
return if suppress_message?(msg)
|
|
14
62
|
|
|
15
63
|
super(message, &block)
|
|
16
64
|
end
|
|
17
65
|
end
|
|
18
66
|
|
|
67
|
+
def suppress_message?(message)
|
|
68
|
+
message.match?(SUPPRESS_PATTERN) || message.match?(CABLE_WEBSOCKET_REQUEST_PATTERN)
|
|
69
|
+
end
|
|
70
|
+
|
|
19
71
|
# Tagged-logging compat — the block body still passes through the filter.
|
|
20
72
|
def tagged(*tags, &block)
|
|
21
73
|
if __getobj__.respond_to?(:tagged)
|
|
22
|
-
__getobj__.tagged(*tags, &block)
|
|
74
|
+
tagged_logger = __getobj__.tagged(*tags, &block)
|
|
75
|
+
block ? tagged_logger : self.class.new(tagged_logger)
|
|
23
76
|
elsif block
|
|
24
77
|
block.call
|
|
25
78
|
else
|
|
@@ -52,5 +105,10 @@ module Mbeditor
|
|
|
52
105
|
|
|
53
106
|
nil
|
|
54
107
|
end
|
|
108
|
+
|
|
109
|
+
def flush
|
|
110
|
+
clear_tags!
|
|
111
|
+
__getobj__.flush if __getobj__.respond_to?(:flush)
|
|
112
|
+
end
|
|
55
113
|
end
|
|
56
114
|
end
|
data/lib/mbeditor/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mbeditor
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oliver Noonan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-04-
|
|
11
|
+
date: 2026-04-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|