debug_logging 4.0.5 → 4.1.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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +16 -1
- data/README.md +1 -1
- data/lib/debug_logging/class_logger.rb +3 -2
- data/lib/debug_logging/class_notifier.rb +3 -2
- data/lib/debug_logging/instance_logger.rb +23 -23
- data/lib/debug_logging/instance_notifier.rb +3 -2
- data/lib/debug_logging/util.rb +6 -1
- data/lib/debug_logging/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 07a1d4c942b3a784a80ee0b72882b3c3c1d098a16e1e789963051e92c9ad4ae0
|
|
4
|
+
data.tar.gz: 9cd8ebc10d446eb9bb25088180a3f078dea600248a2a4144c7d1f4c6a719f32d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4534e3a8bba1767e856e3ac60f855d8ab4100cfa2d1fc23102ee657592ada1473ceac57826fd730e5e9c9b0072f35a869134e5755db7fecde6b1a7e922505ffe
|
|
7
|
+
data.tar.gz: b651325b49c4cfbcf475b100a64f9858eed735a0c9087d24b1bbdcff999e4b2ce20dd8c571e6a454ba5b95231e33c7c98cd8c5f73c50c66926ff9f9fc537a1ff
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,19 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
30
30
|
|
|
31
31
|
### Security
|
|
32
32
|
|
|
33
|
+
## [4.1.0] - 2026-07-02
|
|
34
|
+
|
|
35
|
+
- TAG: [v4.1.0][4.1.0t]
|
|
36
|
+
- COVERAGE: 97.46% -- 730/749 lines in 28 files
|
|
37
|
+
- BRANCH COVERAGE: 86.34% -- 177/205 branches in 28 files
|
|
38
|
+
- 20.94% documented
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
|
|
42
|
+
- Ruby keyword option support for `logged`, `notified`, `i_logged`, and
|
|
43
|
+
`i_notified`, while preserving legacy last-hash configuration and payload
|
|
44
|
+
handling.
|
|
45
|
+
|
|
33
46
|
## [4.0.5] - 2026-07-02
|
|
34
47
|
|
|
35
48
|
- TAG: [v4.0.5][4.0.5t]
|
|
@@ -312,7 +325,9 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
|
312
325
|
|
|
313
326
|
- Initial release
|
|
314
327
|
|
|
315
|
-
[Unreleased]: https://github.com/galtzo-floss/debug_logging/compare/v4.0
|
|
328
|
+
[Unreleased]: https://github.com/galtzo-floss/debug_logging/compare/v4.1.0...HEAD
|
|
329
|
+
[4.1.0]: https://github.com/galtzo-floss/debug_logging/compare/v4.0.5...v4.1.0
|
|
330
|
+
[4.1.0t]: https://github.com/galtzo-floss/debug_logging/releases/tag/v4.1.0
|
|
316
331
|
[4.0.5]: https://github.com/galtzo-floss/debug_logging/compare/v4.0.4...v4.0.5
|
|
317
332
|
[4.0.5t]: https://github.com/galtzo-floss/debug_logging/releases/tag/v4.0.5
|
|
318
333
|
[4.0.4]: https://github.com/galtzo-floss/debug_logging/compare/v4.0.3...v4.0.4
|
data/README.md
CHANGED
|
@@ -797,7 +797,7 @@ Thanks for RTFM. ☺️
|
|
|
797
797
|
[📌gitmoji]: https://gitmoji.dev
|
|
798
798
|
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
799
799
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
800
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.
|
|
800
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.749-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
801
801
|
[🔐security]: https://github.com/galtzo-floss/debug_logging/blob/main/SECURITY.md
|
|
802
802
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
803
803
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
|
@@ -6,11 +6,12 @@ module DebugLogging
|
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
def logged(*methods_to_log)
|
|
9
|
+
def logged(*methods_to_log, **options)
|
|
10
10
|
methods_to_log, payload, config_opts = DebugLogging::Util.extract_payload_and_config(
|
|
11
11
|
method_names: methods_to_log,
|
|
12
12
|
payload: nil,
|
|
13
|
-
config: nil
|
|
13
|
+
config: nil,
|
|
14
|
+
options:
|
|
14
15
|
)
|
|
15
16
|
Array(methods_to_log).each do |decorated_method|
|
|
16
17
|
decorated_method, method_payload, method_config_opts = DebugLogging::Util.extract_payload_and_config(
|
|
@@ -6,11 +6,12 @@ module DebugLogging
|
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
def notified(*methods_to_notify)
|
|
9
|
+
def notified(*methods_to_notify, **options)
|
|
10
10
|
methods_to_notify, payload, config_opts = DebugLogging::Util.extract_payload_and_config(
|
|
11
11
|
method_names: methods_to_notify,
|
|
12
12
|
payload: nil,
|
|
13
|
-
config: nil
|
|
13
|
+
config: nil,
|
|
14
|
+
options:
|
|
14
15
|
)
|
|
15
16
|
Array(methods_to_notify).each do |decorated_method|
|
|
16
17
|
decorated_method, method_payload, method_config_opts = DebugLogging::Util.extract_payload_and_config(
|
|
@@ -6,33 +6,33 @@ module DebugLogging
|
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
# NOTE: These
|
|
9
|
+
# NOTE: These options can also be passed in / hidden in a last hash of *args
|
|
10
10
|
# NOTE: They can also be passed in discretely for each method, by passing *args as an array of arrays
|
|
11
|
-
#
|
|
12
|
-
# @
|
|
13
|
-
# @
|
|
14
|
-
# @
|
|
15
|
-
# @
|
|
16
|
-
# @
|
|
17
|
-
# @
|
|
18
|
-
# @
|
|
19
|
-
# @
|
|
20
|
-
# @
|
|
21
|
-
# @
|
|
22
|
-
# @
|
|
23
|
-
# @
|
|
24
|
-
# @
|
|
25
|
-
# @
|
|
26
|
-
# @
|
|
27
|
-
# @
|
|
28
|
-
# @
|
|
29
|
-
# @
|
|
30
|
-
|
|
31
|
-
def i_logged(*methods_to_log)
|
|
11
|
+
# @option options [Logger] :logger Logger.new($stdout), # probably want to override to be the Rails.logger
|
|
12
|
+
# @option options [Symbol] :log_level default: :debug, at what level do the messages created by this gem sent at?
|
|
13
|
+
# @option options [true, false] :multiple_last_hashes default: false,
|
|
14
|
+
# @option options [nil, Proc] :last_hash_to_s_proc default: nil, e.g. ->(hash) { "keys: #{hash.keys}" }
|
|
15
|
+
# @option options [Integer] :last_hash_max_length default: 1_000,
|
|
16
|
+
# @option options [nil, Proc] :args_to_s_proc default: nil, e.g. ->(*record) { "record id: #{record.first.id}" }
|
|
17
|
+
# @option options [Integer] :args_max_length default: 1_000,
|
|
18
|
+
# @option options [false, Proc] :colorized_chain_for_method default: false, e.g. ->(colorized_string) { colorized_string.red.on_blue.underline }
|
|
19
|
+
# @option options [false, Proc] :colorized_chain_for_class default: false, e.g. ->(colorized_string) { colorized_string.colorize(:light_blue ).colorize( :background => :red) }
|
|
20
|
+
# @option options [true, false] :add_invocation_id default: true, allows unique identification of method call; association of entry and exit log lines
|
|
21
|
+
# @option options [String] :ellipsis default: " ✂️ …".freeze,
|
|
22
|
+
# @option options [true, false] :mark_scope_exit default: false,
|
|
23
|
+
# @option options [true, false, Proc] :add_payload default: true, # Can also be a proc returning a string, which will be called when printing the payload
|
|
24
|
+
# @option options [Integer] :payload_max_length default: 1_000,
|
|
25
|
+
# @option options [nil, Proc] :error_handler_proc default: nil,
|
|
26
|
+
# @option options [nil, Proc] :time_formatter_proc default: DebugLogging::Constants::DEFAULT_TIME_FORMATTER,
|
|
27
|
+
# @option options [true, false] :add_timestamp default: false,
|
|
28
|
+
# @option options [true, false] :instance_benchmarks default: false,
|
|
29
|
+
# @option options [true, false] :class_benchmarks default: false,
|
|
30
|
+
def i_logged(*methods_to_log, **options)
|
|
32
31
|
methods_to_log, payload, config_opts = DebugLogging::Util.extract_payload_and_config(
|
|
33
32
|
method_names: methods_to_log,
|
|
34
33
|
payload: nil,
|
|
35
|
-
config: nil
|
|
34
|
+
config: nil,
|
|
35
|
+
options:
|
|
36
36
|
)
|
|
37
37
|
instance_method_modules =
|
|
38
38
|
Array(methods_to_log).map do |decorated_method|
|
|
@@ -6,11 +6,12 @@ module DebugLogging
|
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
def i_notified(*methods_to_log)
|
|
9
|
+
def i_notified(*methods_to_log, **options)
|
|
10
10
|
method_names, payload, config_opts = DebugLogging::Util.extract_payload_and_config(
|
|
11
11
|
method_names: methods_to_log,
|
|
12
12
|
payload: nil,
|
|
13
|
-
config: nil
|
|
13
|
+
config: nil,
|
|
14
|
+
options:
|
|
14
15
|
)
|
|
15
16
|
instance_method_notifier = DebugLogging::InstanceNotifierModulizer.to_mod(
|
|
16
17
|
methods_to_notify: Array(method_names),
|
data/lib/debug_logging/util.rb
CHANGED
|
@@ -18,7 +18,7 @@ module DebugLogging
|
|
|
18
18
|
|
|
19
19
|
# methods_to_log may be an array of a single method name, followed by config options and payload,
|
|
20
20
|
# or it could be an array of method names followed by config options and payload to be shared by the whole set.
|
|
21
|
-
def extract_payload_and_config(method_names:, payload: nil, config: nil)
|
|
21
|
+
def extract_payload_and_config(method_names:, payload: nil, config: nil, options: nil)
|
|
22
22
|
# When scoped config is present it will always be a new configuration instance per method
|
|
23
23
|
# When scoped config is not present it will reuse the class' configuration object
|
|
24
24
|
scoped_payload = (method_names.is_a?(Array) && method_names.last.is_a?(Hash) && method_names.pop.clone(freeze: false)) || {}
|
|
@@ -32,6 +32,11 @@ module DebugLogging
|
|
|
32
32
|
unless payload.empty?
|
|
33
33
|
DebugLogging::Configuration::CONFIG_KEYS.each { |k| config_opts[k] = payload.delete(k) if payload.key?(k) }
|
|
34
34
|
end
|
|
35
|
+
if options && !options.empty?
|
|
36
|
+
scoped_options = options.clone(freeze: false)
|
|
37
|
+
DebugLogging::Configuration::CONFIG_KEYS.each { |k| config_opts[k] = scoped_options.delete(k) if scoped_options.key?(k) }
|
|
38
|
+
payload.merge!(scoped_options)
|
|
39
|
+
end
|
|
35
40
|
method_names =
|
|
36
41
|
case method_names
|
|
37
42
|
when Symbol
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: debug_logging
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0
|
|
4
|
+
version: 4.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter H. Boling
|
|
@@ -318,10 +318,10 @@ licenses:
|
|
|
318
318
|
- MIT
|
|
319
319
|
metadata:
|
|
320
320
|
homepage_uri: https://debug-logging.galtzo.com/
|
|
321
|
-
source_code_uri: https://github.com/galtzo-floss/debug_logging/tree/v4.0
|
|
322
|
-
changelog_uri: https://github.com/galtzo-floss/debug_logging/blob/v4.0
|
|
321
|
+
source_code_uri: https://github.com/galtzo-floss/debug_logging/tree/v4.1.0
|
|
322
|
+
changelog_uri: https://github.com/galtzo-floss/debug_logging/blob/v4.1.0/CHANGELOG.md
|
|
323
323
|
bug_tracker_uri: https://github.com/galtzo-floss/debug_logging/issues
|
|
324
|
-
documentation_uri: https://www.rubydoc.info/gems/debug_logging/4.0
|
|
324
|
+
documentation_uri: https://www.rubydoc.info/gems/debug_logging/4.1.0
|
|
325
325
|
funding_uri: https://github.com/sponsors/pboling
|
|
326
326
|
wiki_uri: https://github.com/galtzo-floss/debug_logging/wiki
|
|
327
327
|
news_uri: https://www.railsbling.com/tags/debug_logging
|
metadata.gz.sig
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
(���6v��};~�R�7����h�T��Ӵ�*��F��\$H����'\���bmTRQ/�5��8��殎'LB��{�����"�_��o58O�[E�R?W���5�^�<�s�U����u�w靅�A�1����
|
|
1
|
+
�����d&M4�&Er�˗y��9�"Ƚ77�a�?��Xo�t��^��`��;~>d9|���_=�S%� G�Ǵ�����IE?��Y"}!0�|��W��8go�½͘�i��Vn��ȽD�H���gR�
|
|
2
|
+
9{L�}U OT)fm��bx�l�EUAH{�>�B��Ml�^�yE�[c�aVR�~/� �f��r�}�XL��=�jS�;I���iE�%V�a�KMpG�F@���F���J���� ��PԄ�;$��w�����$#���?�l�"�k�$���i��1�����#�dFsͻZ>���c�t�M��l�kt�V�&U!
|