pantheios-ruby 0.22.0.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 (61) hide show
  1. checksums.yaml +5 -5
  2. data/AUTHORS.md +21 -0
  3. data/CHANGES.md +337 -0
  4. data/CONTRIBUTING.md +36 -0
  5. data/EXAMPLES.md +11 -0
  6. data/FAQ.md +28 -0
  7. data/INSTALL.md +43 -0
  8. data/LICENSE +21 -20
  9. data/NEWS.md +65 -0
  10. data/README.md +134 -2
  11. data/Rakefile +21 -0
  12. data/SECURITY.md +23 -0
  13. data/TODO.md +29 -0
  14. data/examples/coloured_console_log_service.rb +1 -1
  15. data/examples/multiple_modules.md +1 -1
  16. data/examples/multiple_modules.rb +36 -36
  17. data/examples/simple_logging.md +1 -1
  18. data/examples/simple_logging.rb +1 -1
  19. data/examples/threshold_front_end.rb +1 -1
  20. data/lib/pantheios/api.rb +156 -155
  21. data/lib/pantheios/application_layer/param_name_list.rb +1 -0
  22. data/lib/pantheios/application_layer/stock_severity_levels.rb +110 -111
  23. data/lib/pantheios/application_layer.rb +6 -5
  24. data/lib/pantheios/core.rb +416 -415
  25. data/lib/pantheios/front_ends/threshold_front_end.rb +81 -81
  26. data/lib/pantheios/globals.rb +45 -45
  27. data/lib/pantheios/services/coloured_console_log_service.rb +96 -96
  28. data/lib/pantheios/services/common/console.rb +58 -57
  29. data/lib/pantheios/services/multiplexing_log_service.rb +151 -150
  30. data/lib/pantheios/services/null_log_service.rb +11 -11
  31. data/lib/pantheios/services/simple_console_log_service.rb +20 -20
  32. data/lib/pantheios/services/simple_file_log_service.rb +112 -113
  33. data/lib/pantheios/services/standard_log_service_adapter.rb +119 -119
  34. data/lib/pantheios/services.rb +1 -0
  35. data/lib/pantheios/util/process_util.rb +25 -24
  36. data/lib/pantheios/util/reflection_util.rb +14 -13
  37. data/lib/pantheios/util/thread_util.rb +50 -49
  38. data/lib/pantheios/util/version_util.rb +34 -33
  39. data/lib/pantheios/util.rb +1 -0
  40. data/lib/pantheios/version.rb +19 -19
  41. data/lib/pantheios.rb +12 -12
  42. data/test/performance/test_perf_simple_statements.rb +58 -58
  43. data/test/performance/test_perf_trace_variants.rb +43 -57
  44. data/test/scratch/log_rolling_by_period_daily.rb +3 -3
  45. data/test/scratch/log_rolling_by_size_and_depth.rb +3 -3
  46. data/test/scratch/log_using_blocks.rb +12 -12
  47. data/test/scratch/multiplexing_log_service.rb +32 -32
  48. data/test/unit/application_layer/tc_param_name_list.rb +13 -13
  49. data/test/unit/application_layer/tc_stock_severity_levels.rb +102 -102
  50. data/test/unit/core/tc_core_1.rb +24 -24
  51. data/test/unit/front_ends/tc_threshold_front_end.rb +65 -65
  52. data/test/unit/services/tc_multiplexing_log_service.rb +79 -79
  53. data/test/unit/services/tc_null_log_service.rb +42 -42
  54. data/test/unit/services/tc_simple_console_log_service.rb +70 -70
  55. data/test/unit/services/tc_simple_file_log_service.rb +146 -146
  56. data/test/unit/services/tc_standard_log_service_adapter.rb +94 -96
  57. data/test/unit/util/tc_process_util.rb +6 -6
  58. data/test/unit/util/tc_reflection_util.rb +20 -20
  59. data/test/unit/util/tc_thread_util.rb +46 -46
  60. data/test/unit/util/tc_version_util.rb +47 -47
  61. metadata +33 -12
@@ -1,4 +1,4 @@
1
-
1
+ # frozen_string_literal: true
2
2
  # ######################################################################## #
3
3
  # File: lib/pantheios/application_layer/stock_severity_levels.rb
4
4
  #
@@ -7,14 +7,14 @@
7
7
  # namespace module
8
8
  #
9
9
  # Created: 2nd April 2011
10
- # Updated: 4th June 2020
10
+ # Updated: 28th August 2026
11
11
  #
12
- # Home: http://github.com/synesissoftware/Pantheios-Ruby
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,158 +55,157 @@ module ApplicationLayer
55
55
 
56
56
  module StockSeverityLevels
57
57
 
58
- private
59
- # @!visibility private
60
- module Internal_ # :nodoc: all
61
-
62
- # @!visibility private
63
- STOCK_SEVERITY_LEVELS_ = {
58
+ private
59
+ # @!visibility private
60
+ module Internal_ # :nodoc: all
64
61
 
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
- }
62
+ # @!visibility private
63
+ STOCK_SEVERITY_LEVELS_ = {
81
64
 
82
- # @!visibility private
83
- def self.create_level_keys m # :nodoc:
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
+ }
84
81
 
85
- r = m.keys
82
+ # @!visibility private
83
+ def self.create_level_keys m # :nodoc:
86
84
 
87
- m.each do |k, ar|
85
+ r = m.keys
88
86
 
89
- (ar[3] || []).each do |al|
87
+ m.each do |k, ar|
90
88
 
91
- r << al
92
- end
93
- end
89
+ (ar[3] || []).each do |al|
94
90
 
95
- r.uniq
96
- end
91
+ r << al
92
+ end
93
+ end
97
94
 
98
- # @!visibility private
99
- def self.create_level_value_map m # :nodoc:
95
+ r.uniq
96
+ end
100
97
 
101
- r = {}
98
+ # @!visibility private
99
+ def self.create_level_value_map m # :nodoc:
102
100
 
103
- m.each do |sev, ar|
101
+ r = {}
104
102
 
105
- warn 'invalid start-up' unless ::Symbol === sev
106
- warn 'invalid start-up' unless ::Array === ar
103
+ m.each do |sev, ar|
107
104
 
108
- ([sev] + (ar[3] || [])).each do |al|
105
+ warn 'invalid start-up' unless ::Symbol === sev
106
+ warn 'invalid start-up' unless ::Array === ar
109
107
 
110
- r[al] = ar[0]
111
- end
112
- end
108
+ ([sev] + (ar[3] || [])).each do |al|
113
109
 
114
- r
115
- end
110
+ r[al] = ar[0]
111
+ end
112
+ end
116
113
 
117
- # @!visibility private
118
- def self.create_level_string_map m # :nodoc:
114
+ r
115
+ end
119
116
 
120
- r = {}
117
+ # @!visibility private
118
+ def self.create_level_string_map m # :nodoc:
121
119
 
122
- m.each do |sev, ar|
120
+ r = {}
123
121
 
124
- warn 'invalid start-up' unless ::Symbol === sev
125
- warn 'invalid start-up' unless ::Array === ar
122
+ m.each do |sev, ar|
126
123
 
127
- ([sev] + (ar[3] || [])).each do |al|
124
+ warn 'invalid start-up' unless ::Symbol === sev
125
+ warn 'invalid start-up' unless ::Array === ar
128
126
 
129
- s = ar[1]
127
+ s = ar[1].dup
128
+ s.define_singleton_method(:severity) { sev }
130
129
 
131
- s.define_singleton_method(:severity) { sev }
130
+ ([sev] + (ar[3] || [])).each do |al|
132
131
 
133
- r[al] = s
134
- end
135
- end
132
+ r[al] = s
133
+ end
134
+ end
136
135
 
137
- r
138
- end
136
+ r
137
+ end
139
138
 
140
- # @!visibility private
141
- def self.create_level_aliases m # :nodoc:
139
+ # @!visibility private
140
+ def self.create_level_aliases m # :nodoc:
142
141
 
143
- r = {}
142
+ r = {}
144
143
 
145
- m.each do |sev, ar|
144
+ m.each do |sev, ar|
146
145
 
147
- warn 'invalid start-up' unless ::Symbol === sev
148
- warn 'invalid start-up' unless ::Array === ar
146
+ warn 'invalid start-up' unless ::Symbol === sev
147
+ warn 'invalid start-up' unless ::Array === ar
149
148
 
150
- ([sev] + (ar[3] || [])).each do |al|
149
+ ([sev] + (ar[3] || [])).each do |al|
151
150
 
152
- r[al] = sev
153
- end
154
- end
151
+ r[al] = sev
152
+ end
153
+ end
155
154
 
156
- r
157
- end
155
+ r
156
+ end
158
157
 
159
- # @!visibility private
160
- def self.create_level_relative_map m # :nodoc:
158
+ # @!visibility private
159
+ def self.create_level_relative_map m # :nodoc:
161
160
 
162
- r = {}
161
+ r = {}
163
162
 
164
- m.each do |sev, ar|
163
+ m.each do |sev, ar|
165
164
 
166
- warn 'invalid start-up' unless ::Symbol === sev
167
- warn 'invalid start-up' unless ::Array === ar
165
+ warn 'invalid start-up' unless ::Symbol === sev
166
+ warn 'invalid start-up' unless ::Array === ar
168
167
 
169
- relativity = ar[2]
168
+ relativity = ar[2]
170
169
 
171
- case relativity
172
- when :relative
170
+ case relativity
171
+ when :relative
173
172
 
174
- ([sev] + (ar[3] || [])).each do |al|
173
+ ([sev] + (ar[3] || [])).each do |al|
175
174
 
176
- r[al] = relativity
177
- end
178
- else
175
+ r[al] = relativity
176
+ end
177
+ else
179
178
 
180
- ;
181
- end
182
- end
179
+ ;
180
+ end
181
+ end
183
182
 
184
- r
185
- end
186
- end
187
- public
183
+ r
184
+ end
185
+ end
186
+ public
188
187
 
189
- # Ordered list of stock severity level symbols, without any aliases
190
- 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
191
190
 
192
- # Unordered list of stock severity levels, some of which may be aliases
193
- 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_
194
193
 
195
- # Mapping of severity level aliases - with may be symbols and strings -
196
- # to the prime stock severity level symbols
197
- 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_
198
197
 
199
- # Mapping of severity level aliases - with may be symbols and strings -
200
- # containing only those levels that are relative, i.e. may participate
201
- # meaningfully in a threshold-based filtering
202
- 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_
203
202
 
204
- # Mapping of severity level (and level alias) symbols to integral
205
- # equivalent
206
- 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_
207
206
 
208
- # Mapping of severity level (and level alias) symbols to string
209
- 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_
210
209
 
211
210
  end # module StockSeverityLevels
212
211
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  require 'pantheios/application_layer/param_name_list'
3
4
  require 'pantheios/application_layer/stock_severity_levels'
@@ -7,13 +8,13 @@ require 'pantheios/core'
7
8
  module Pantheios
8
9
  module ApplicationLayer
9
10
 
10
- # @!visibility private
11
- def self.included receiver # :nodoc:
11
+ # @!visibility private
12
+ def self.included receiver # :nodoc:
12
13
 
13
- receiver.extend self
14
+ receiver.extend self
14
15
 
15
- ::Pantheios::Core.register_include self, receiver
16
- end
16
+ ::Pantheios::Core.register_include self, receiver
17
+ end
17
18
 
18
19
  end # module ApplicationLayer
19
20
  end # module Pantheios