dvla-herodotus 2.3.1 → 2.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d295b22355aa8831f1ae6a1401560b06e3ab22da60647a68a2e2f11d4ed19087
4
- data.tar.gz: 9a18e2310d62f1bb9f71a5785b4714e18ebac9d7ef68bd7b27aafd46fb3b80d0
3
+ metadata.gz: 8ef5bb32768faf3905e84a5aa343b4905d490dfda82fd8e350e985d10387a439
4
+ data.tar.gz: bf979b603e8cb1a2cfca96bb1ff837a313e0263910eef4c08b8902920bb1a462
5
5
  SHA512:
6
- metadata.gz: 57be084aba32ce6c0a938442600ae034fe0ae31ebc7a77ffe0605137ce10a28d6fdd346311708e3f242330005cc513523faff67052b745def965588b9d18bbf0
7
- data.tar.gz: 240ad9c21db389debbad9a36f2dfe22fd7142b7ace789d0cf40825003e5ecc353a210e64d0151c0272aa5f4e142c41ee03f26a92b40ccdf2c31fe1d70322c24f
6
+ metadata.gz: 62168b57257f7d376c0ca807a61822cceeb612a8eb2744e6b29755ead02b80e934317eaa56667c267407d8131324261e69a41c6e75b0d78c1f1b3e0ef126bc67
7
+ data.tar.gz: b416dfe7ca587ef5ad83b04a748b7966b3c0da1336164f7cbea36330298ed8a5acc23e00ffda7b7e05075de595fee35116d6a58a4806e88bfec89e71130d2742
data/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [2.3.2] - 2025-12-23
5
+ - Add 'spawn_child_logger' method to allow other processes to inherit the current logger's configuration
6
+
4
7
  ## [2.3.1] - 2025-11-21
5
8
  - Fixed issue with output_path in create_logger, will now make a directory if it did not exist
6
9
 
data/README.md CHANGED
@@ -102,6 +102,22 @@ You can call `new_scenario` with the identifier just before each scenario to cre
102
102
  logger.new_scenario('Scenario Id')
103
103
  ```
104
104
 
105
+ ### spawn_child_logger method
106
+ You can call `spawn_child_logger` with a new system_name which will retain the current logger's config.
107
+ This enables you to pass loggers to other tools and maintain the same colourisation and output_path.
108
+
109
+ ```ruby
110
+ config = DVLA::Herodotus.config do |configuration|
111
+ configuration.display_pid = false
112
+ configuration.main = true
113
+ configuration.prefix_colour = {
114
+ overall: %w[blue bold],
115
+ }
116
+ end
117
+ LOG = DVLA::Herodotus.logger('<system-name>', config:, output_path: -> { "log.txt" })
118
+ NewTool.new(logger: LOG.spawn_child_logger(system_name: 'new gem'))
119
+ ```
120
+
105
121
  ---
106
122
  ### Strings
107
123
 
@@ -58,6 +58,16 @@ module DVLA
58
58
  end
59
59
  end
60
60
 
61
+ # Creates a new logger with a different system name but inherits config and output path
62
+ def spawn_child_logger(system_name:)
63
+ config = DVLA::Herodotus.config do |c|
64
+ c.display_pid = @display_pid
65
+ c.main = false
66
+ c.prefix_colour = @prefix_colour
67
+ end
68
+ HerodotusLogger.new(system_name, @logdev.dev, config: config)
69
+ end
70
+
61
71
  %i[debug info warn error fatal].each do |log_level|
62
72
  define_method log_level do |progname = nil, &block|
63
73
  set_proc_writer_scenario
@@ -1,5 +1,5 @@
1
1
  module DVLA
2
2
  module Herodotus
3
- VERSION = '2.3.1'.freeze
3
+ VERSION = '2.3.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dvla-herodotus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Driver and Vehicle Licensing Agency (DVLA)
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-12-08 00:00:00.000000000 Z
12
+ date: 2026-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dvla-lint