pantheios-ruby 0.22.2 → 0.22.3

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +26 -0
  3. data/NEWS.md +1 -0
  4. data/TODO.md +5 -2
  5. data/examples/coloured_console_log_service.rb +1 -1
  6. data/examples/multiple_modules.rb +36 -36
  7. data/examples/simple_logging.rb +1 -1
  8. data/examples/threshold_front_end.rb +1 -1
  9. data/lib/pantheios/api.rb +154 -153
  10. data/lib/pantheios/application_layer/stock_severity_levels.rb +108 -108
  11. data/lib/pantheios/application_layer.rb +5 -5
  12. data/lib/pantheios/core.rb +415 -414
  13. data/lib/pantheios/front_ends/threshold_front_end.rb +79 -79
  14. data/lib/pantheios/globals.rb +43 -43
  15. data/lib/pantheios/services/coloured_console_log_service.rb +94 -94
  16. data/lib/pantheios/services/common/console.rb +57 -57
  17. data/lib/pantheios/services/multiplexing_log_service.rb +149 -148
  18. data/lib/pantheios/services/null_log_service.rb +9 -9
  19. data/lib/pantheios/services/simple_console_log_service.rb +18 -18
  20. data/lib/pantheios/services/simple_file_log_service.rb +110 -111
  21. data/lib/pantheios/services/standard_log_service_adapter.rb +117 -117
  22. data/lib/pantheios/util/process_util.rb +24 -24
  23. data/lib/pantheios/util/reflection_util.rb +13 -13
  24. data/lib/pantheios/util/thread_util.rb +49 -49
  25. data/lib/pantheios/util/version_util.rb +33 -33
  26. data/lib/pantheios/version.rb +12 -12
  27. data/lib/pantheios.rb +11 -11
  28. data/test/performance/test_perf_simple_statements.rb +58 -58
  29. data/test/performance/test_perf_trace_variants.rb +43 -57
  30. data/test/scratch/log_rolling_by_period_daily.rb +3 -3
  31. data/test/scratch/log_rolling_by_size_and_depth.rb +3 -3
  32. data/test/scratch/log_using_blocks.rb +12 -12
  33. data/test/scratch/multiplexing_log_service.rb +32 -32
  34. data/test/unit/application_layer/tc_param_name_list.rb +13 -13
  35. data/test/unit/application_layer/tc_stock_severity_levels.rb +102 -102
  36. data/test/unit/core/tc_core_1.rb +24 -24
  37. data/test/unit/front_ends/tc_threshold_front_end.rb +65 -65
  38. data/test/unit/services/tc_multiplexing_log_service.rb +79 -79
  39. data/test/unit/services/tc_null_log_service.rb +42 -42
  40. data/test/unit/services/tc_simple_console_log_service.rb +70 -70
  41. data/test/unit/services/tc_simple_file_log_service.rb +146 -146
  42. data/test/unit/services/tc_standard_log_service_adapter.rb +94 -96
  43. data/test/unit/util/tc_process_util.rb +6 -6
  44. data/test/unit/util/tc_reflection_util.rb +20 -20
  45. data/test/unit/util/tc_thread_util.rb +46 -46
  46. data/test/unit/util/tc_version_util.rb +47 -47
  47. metadata +6 -6
@@ -7,14 +7,14 @@
7
7
  # namespace module
8
8
  #
9
9
  # Created: 2nd April 2011
10
- # Updated: 15th August 2026
10
+ # Updated: 28th August 2026
11
11
  #
12
12
  # Home: https://github.com/synesissoftware/Pantheios.Ruby
13
13
  #
14
14
  # Author: Matthew Wilson
15
15
  #
16
- # Copyright (c) 2019-2020, Matthew Wilson and Synesis Information Systems
17
- # Copyright (c) 2011-2018, Matthew Wilson and Synesis Software
16
+ # Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
17
+ # Copyright (c) 2011-2019, Matthew Wilson and Synesis Software
18
18
  # All rights reserved.
19
19
  #
20
20
  # Redistribution and use in source and binary forms, with or without
@@ -55,157 +55,157 @@ module ApplicationLayer
55
55
 
56
56
  module StockSeverityLevels
57
57
 
58
- private
59
- # @!visibility private
60
- module Internal_ # :nodoc: all
58
+ private
59
+ # @!visibility private
60
+ module Internal_ # :nodoc: all
61
61
 
62
- # @!visibility private
63
- STOCK_SEVERITY_LEVELS_ = {
62
+ # @!visibility private
63
+ STOCK_SEVERITY_LEVELS_ = {
64
64
 
65
- :violation => [ 1, 'Violation', :relative, [ :emergency ] ],
66
- :alert => [ 2, 'Alert', :relative ],
67
- :critical => [ 3, 'Critical', :relative ],
68
- :failure => [ 4, 'Failure', :relative, [ :fail ] ],
69
- :warning => [ 5, 'Warning', :relative, [ :warn ] ],
70
- :notice => [ 6, 'Notice', :relative ],
71
- :informational => [ 7, 'Informational', :relative, [ :info ] ],
72
- :debug0 => [ 8, 'Debug-0', :relative ],
73
- :debug1 => [ 9, 'Debug-1', :relative ],
74
- :debug2 => [ 10, 'Debug-2', :relative ],
75
- :debug3 => [ 11, 'Debug-3', :relative ],
76
- :debug4 => [ 12, 'Debug-4', :relative ],
77
- :debug5 => [ 13, 'Debug-5', :relative ],
78
- :trace => [ 15, 'Trace', :relative ],
79
- :benchmark => [ 16, 'Benchmark', :separate ],
80
- }
65
+ :violation => [ 1, 'Violation', :relative, [ :emergency ] ],
66
+ :alert => [ 2, 'Alert', :relative ],
67
+ :critical => [ 3, 'Critical', :relative ],
68
+ :failure => [ 4, 'Failure', :relative, [ :fail ] ],
69
+ :warning => [ 5, 'Warning', :relative, [ :warn ] ],
70
+ :notice => [ 6, 'Notice', :relative ],
71
+ :informational => [ 7, 'Informational', :relative, [ :info ] ],
72
+ :debug0 => [ 8, 'Debug-0', :relative ],
73
+ :debug1 => [ 9, 'Debug-1', :relative ],
74
+ :debug2 => [ 10, 'Debug-2', :relative ],
75
+ :debug3 => [ 11, 'Debug-3', :relative ],
76
+ :debug4 => [ 12, 'Debug-4', :relative ],
77
+ :debug5 => [ 13, 'Debug-5', :relative ],
78
+ :trace => [ 15, 'Trace', :relative ],
79
+ :benchmark => [ 16, 'Benchmark', :separate ],
80
+ }
81
81
 
82
- # @!visibility private
83
- def self.create_level_keys m # :nodoc:
82
+ # @!visibility private
83
+ def self.create_level_keys m # :nodoc:
84
84
 
85
- r = m.keys
85
+ r = m.keys
86
86
 
87
- m.each do |k, ar|
87
+ m.each do |k, ar|
88
88
 
89
- (ar[3] || []).each do |al|
89
+ (ar[3] || []).each do |al|
90
90
 
91
- r << al
92
- end
93
- end
91
+ r << al
92
+ end
93
+ end
94
94
 
95
- r.uniq
96
- end
95
+ r.uniq
96
+ end
97
97
 
98
- # @!visibility private
99
- def self.create_level_value_map m # :nodoc:
98
+ # @!visibility private
99
+ def self.create_level_value_map m # :nodoc:
100
100
 
101
- r = {}
101
+ r = {}
102
102
 
103
- m.each do |sev, ar|
103
+ m.each do |sev, ar|
104
104
 
105
- warn 'invalid start-up' unless ::Symbol === sev
106
- warn 'invalid start-up' unless ::Array === ar
105
+ warn 'invalid start-up' unless ::Symbol === sev
106
+ warn 'invalid start-up' unless ::Array === ar
107
107
 
108
- ([sev] + (ar[3] || [])).each do |al|
108
+ ([sev] + (ar[3] || [])).each do |al|
109
109
 
110
- r[al] = ar[0]
111
- end
112
- end
110
+ r[al] = ar[0]
111
+ end
112
+ end
113
113
 
114
- r
115
- end
114
+ r
115
+ end
116
116
 
117
- # @!visibility private
118
- def self.create_level_string_map m # :nodoc:
117
+ # @!visibility private
118
+ def self.create_level_string_map m # :nodoc:
119
119
 
120
- r = {}
120
+ r = {}
121
121
 
122
- m.each do |sev, ar|
122
+ m.each do |sev, ar|
123
123
 
124
- warn 'invalid start-up' unless ::Symbol === sev
125
- warn 'invalid start-up' unless ::Array === ar
124
+ warn 'invalid start-up' unless ::Symbol === sev
125
+ warn 'invalid start-up' unless ::Array === ar
126
126
 
127
- s = ar[1].dup
128
- s.define_singleton_method(:severity) { sev }
127
+ s = ar[1].dup
128
+ s.define_singleton_method(:severity) { sev }
129
129
 
130
- ([sev] + (ar[3] || [])).each do |al|
130
+ ([sev] + (ar[3] || [])).each do |al|
131
131
 
132
- r[al] = s
133
- end
134
- end
132
+ r[al] = s
133
+ end
134
+ end
135
135
 
136
- r
137
- end
136
+ r
137
+ end
138
138
 
139
- # @!visibility private
140
- def self.create_level_aliases m # :nodoc:
139
+ # @!visibility private
140
+ def self.create_level_aliases m # :nodoc:
141
141
 
142
- r = {}
142
+ r = {}
143
143
 
144
- m.each do |sev, ar|
144
+ m.each do |sev, ar|
145
145
 
146
- warn 'invalid start-up' unless ::Symbol === sev
147
- warn 'invalid start-up' unless ::Array === ar
146
+ warn 'invalid start-up' unless ::Symbol === sev
147
+ warn 'invalid start-up' unless ::Array === ar
148
148
 
149
- ([sev] + (ar[3] || [])).each do |al|
149
+ ([sev] + (ar[3] || [])).each do |al|
150
150
 
151
- r[al] = sev
152
- end
153
- end
151
+ r[al] = sev
152
+ end
153
+ end
154
154
 
155
- r
156
- end
155
+ r
156
+ end
157
157
 
158
- # @!visibility private
159
- def self.create_level_relative_map m # :nodoc:
158
+ # @!visibility private
159
+ def self.create_level_relative_map m # :nodoc:
160
160
 
161
- r = {}
161
+ r = {}
162
162
 
163
- m.each do |sev, ar|
163
+ m.each do |sev, ar|
164
164
 
165
- warn 'invalid start-up' unless ::Symbol === sev
166
- warn 'invalid start-up' unless ::Array === ar
165
+ warn 'invalid start-up' unless ::Symbol === sev
166
+ warn 'invalid start-up' unless ::Array === ar
167
167
 
168
- relativity = ar[2]
168
+ relativity = ar[2]
169
169
 
170
- case relativity
171
- when :relative
170
+ case relativity
171
+ when :relative
172
172
 
173
- ([sev] + (ar[3] || [])).each do |al|
173
+ ([sev] + (ar[3] || [])).each do |al|
174
174
 
175
- r[al] = relativity
176
- end
177
- else
175
+ r[al] = relativity
176
+ end
177
+ else
178
178
 
179
- ;
180
- end
181
- end
179
+ ;
180
+ end
181
+ end
182
182
 
183
- r
184
- end
185
- end
186
- public
183
+ r
184
+ end
185
+ end
186
+ public
187
187
 
188
- # Ordered list of stock severity level symbols, without any aliases
189
- STOCK_SEVERITY_LEVELS_PRIME = Internal_::STOCK_SEVERITY_LEVELS_.keys
188
+ # Ordered list of stock severity level symbols, without any aliases
189
+ STOCK_SEVERITY_LEVELS_PRIME = Internal_::STOCK_SEVERITY_LEVELS_.keys
190
190
 
191
- # Unordered list of stock severity levels, some of which may be aliases
192
- STOCK_SEVERITY_LEVELS = Internal_.create_level_keys Internal_::STOCK_SEVERITY_LEVELS_
191
+ # Unordered list of stock severity levels, some of which may be aliases
192
+ STOCK_SEVERITY_LEVELS = Internal_.create_level_keys Internal_::STOCK_SEVERITY_LEVELS_
193
193
 
194
- # Mapping of severity level aliases - with may be symbols and strings -
195
- # to the prime stock severity level symbols
196
- STOCK_SEVERITY_LEVEL_ALIASES = Internal_.create_level_aliases Internal_::STOCK_SEVERITY_LEVELS_
194
+ # Mapping of severity level aliases - with may be symbols and strings -
195
+ # to the prime stock severity level symbols
196
+ STOCK_SEVERITY_LEVEL_ALIASES = Internal_.create_level_aliases Internal_::STOCK_SEVERITY_LEVELS_
197
197
 
198
- # Mapping of severity level aliases - with may be symbols and strings -
199
- # containing only those levels that are relative, i.e. may participate
200
- # meaningfully in a threshold-based filtering
201
- STOCK_SEVERITY_LEVELS_RELATIVE = Internal_.create_level_relative_map Internal_::STOCK_SEVERITY_LEVELS_
198
+ # Mapping of severity level aliases - with may be symbols and strings -
199
+ # containing only those levels that are relative, i.e. may participate
200
+ # meaningfully in a threshold-based filtering
201
+ STOCK_SEVERITY_LEVELS_RELATIVE = Internal_.create_level_relative_map Internal_::STOCK_SEVERITY_LEVELS_
202
202
 
203
- # Mapping of severity level (and level alias) symbols to integral
204
- # equivalent
205
- STOCK_SEVERITY_LEVEL_VALUES = Internal_.create_level_value_map Internal_::STOCK_SEVERITY_LEVELS_
203
+ # Mapping of severity level (and level alias) symbols to integral
204
+ # equivalent
205
+ STOCK_SEVERITY_LEVEL_VALUES = Internal_.create_level_value_map Internal_::STOCK_SEVERITY_LEVELS_
206
206
 
207
- # Mapping of severity level (and level alias) symbols to string
208
- STOCK_SEVERITY_LEVEL_STRINGS = Internal_.create_level_string_map Internal_::STOCK_SEVERITY_LEVELS_
207
+ # Mapping of severity level (and level alias) symbols to string
208
+ STOCK_SEVERITY_LEVEL_STRINGS = Internal_.create_level_string_map Internal_::STOCK_SEVERITY_LEVELS_
209
209
 
210
210
  end # module StockSeverityLevels
211
211
 
@@ -8,13 +8,13 @@ require 'pantheios/core'
8
8
  module Pantheios
9
9
  module ApplicationLayer
10
10
 
11
- # @!visibility private
12
- def self.included receiver # :nodoc:
11
+ # @!visibility private
12
+ def self.included receiver # :nodoc:
13
13
 
14
- receiver.extend self
14
+ receiver.extend self
15
15
 
16
- ::Pantheios::Core.register_include self, receiver
17
- end
16
+ ::Pantheios::Core.register_include self, receiver
17
+ end
18
18
 
19
19
  end # module ApplicationLayer
20
20
  end # module Pantheios