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 +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +16 -0
- data/lib/dvla/herodotus/herodotus_logger.rb +10 -0
- data/lib/dvla/herodotus/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: 8ef5bb32768faf3905e84a5aa343b4905d490dfda82fd8e350e985d10387a439
|
|
4
|
+
data.tar.gz: bf979b603e8cb1a2cfca96bb1ff837a313e0263910eef4c08b8902920bb1a462
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
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.
|
|
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:
|
|
12
|
+
date: 2026-01-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: dvla-lint
|