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.
- checksums.yaml +4 -4
- data/CHANGES.md +26 -0
- data/NEWS.md +1 -0
- data/TODO.md +5 -2
- data/examples/coloured_console_log_service.rb +1 -1
- data/examples/multiple_modules.rb +36 -36
- data/examples/simple_logging.rb +1 -1
- data/examples/threshold_front_end.rb +1 -1
- data/lib/pantheios/api.rb +154 -153
- data/lib/pantheios/application_layer/stock_severity_levels.rb +108 -108
- data/lib/pantheios/application_layer.rb +5 -5
- data/lib/pantheios/core.rb +415 -414
- data/lib/pantheios/front_ends/threshold_front_end.rb +79 -79
- data/lib/pantheios/globals.rb +43 -43
- data/lib/pantheios/services/coloured_console_log_service.rb +94 -94
- data/lib/pantheios/services/common/console.rb +57 -57
- data/lib/pantheios/services/multiplexing_log_service.rb +149 -148
- data/lib/pantheios/services/null_log_service.rb +9 -9
- data/lib/pantheios/services/simple_console_log_service.rb +18 -18
- data/lib/pantheios/services/simple_file_log_service.rb +110 -111
- data/lib/pantheios/services/standard_log_service_adapter.rb +117 -117
- data/lib/pantheios/util/process_util.rb +24 -24
- data/lib/pantheios/util/reflection_util.rb +13 -13
- data/lib/pantheios/util/thread_util.rb +49 -49
- data/lib/pantheios/util/version_util.rb +33 -33
- data/lib/pantheios/version.rb +12 -12
- data/lib/pantheios.rb +11 -11
- data/test/performance/test_perf_simple_statements.rb +58 -58
- data/test/performance/test_perf_trace_variants.rb +43 -57
- data/test/scratch/log_rolling_by_period_daily.rb +3 -3
- data/test/scratch/log_rolling_by_size_and_depth.rb +3 -3
- data/test/scratch/log_using_blocks.rb +12 -12
- data/test/scratch/multiplexing_log_service.rb +32 -32
- data/test/unit/application_layer/tc_param_name_list.rb +13 -13
- data/test/unit/application_layer/tc_stock_severity_levels.rb +102 -102
- data/test/unit/core/tc_core_1.rb +24 -24
- data/test/unit/front_ends/tc_threshold_front_end.rb +65 -65
- data/test/unit/services/tc_multiplexing_log_service.rb +79 -79
- data/test/unit/services/tc_null_log_service.rb +42 -42
- data/test/unit/services/tc_simple_console_log_service.rb +70 -70
- data/test/unit/services/tc_simple_file_log_service.rb +146 -146
- data/test/unit/services/tc_standard_log_service_adapter.rb +94 -96
- data/test/unit/util/tc_process_util.rb +6 -6
- data/test/unit/util/tc_reflection_util.rb +20 -20
- data/test/unit/util/tc_thread_util.rb +46 -46
- data/test/unit/util/tc_version_util.rb +47 -47
- metadata +6 -6
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
# namespace module
|
|
8
8
|
#
|
|
9
9
|
# Created: 2nd April 2011
|
|
10
|
-
# Updated:
|
|
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-
|
|
17
|
-
# Copyright (c) 2011-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
private
|
|
59
|
+
# @!visibility private
|
|
60
|
+
module Internal_ # :nodoc: all
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
# @!visibility private
|
|
63
|
+
STOCK_SEVERITY_LEVELS_ = {
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
83
|
-
|
|
82
|
+
# @!visibility private
|
|
83
|
+
def self.create_level_keys m # :nodoc:
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
r = m.keys
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
m.each do |k, ar|
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
(ar[3] || []).each do |al|
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
r << al
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
r.uniq
|
|
96
|
+
end
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
# @!visibility private
|
|
99
|
+
def self.create_level_value_map m # :nodoc:
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
r = {}
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
m.each do |sev, ar|
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
warn 'invalid start-up' unless ::Symbol === sev
|
|
106
|
+
warn 'invalid start-up' unless ::Array === ar
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
([sev] + (ar[3] || [])).each do |al|
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
r[al] = ar[0]
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
r
|
|
115
|
+
end
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
# @!visibility private
|
|
118
|
+
def self.create_level_string_map m # :nodoc:
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
r = {}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
m.each do |sev, ar|
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
warn 'invalid start-up' unless ::Symbol === sev
|
|
125
|
+
warn 'invalid start-up' unless ::Array === ar
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
s = ar[1].dup
|
|
128
|
+
s.define_singleton_method(:severity) { sev }
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
([sev] + (ar[3] || [])).each do |al|
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
r[al] = s
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
r
|
|
137
|
+
end
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
# @!visibility private
|
|
140
|
+
def self.create_level_aliases m # :nodoc:
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
r = {}
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
m.each do |sev, ar|
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
warn 'invalid start-up' unless ::Symbol === sev
|
|
147
|
+
warn 'invalid start-up' unless ::Array === ar
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
([sev] + (ar[3] || [])).each do |al|
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
r[al] = sev
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
r
|
|
156
|
+
end
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
# @!visibility private
|
|
159
|
+
def self.create_level_relative_map m # :nodoc:
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
r = {}
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
m.each do |sev, ar|
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
warn 'invalid start-up' unless ::Symbol === sev
|
|
166
|
+
warn 'invalid start-up' unless ::Array === ar
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
relativity = ar[2]
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
case relativity
|
|
171
|
+
when :relative
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
([sev] + (ar[3] || [])).each do |al|
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
r[al] = relativity
|
|
176
|
+
end
|
|
177
|
+
else
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
;
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
182
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
r
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
public
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
# Ordered list of stock severity level symbols, without any aliases
|
|
189
|
+
STOCK_SEVERITY_LEVELS_PRIME = Internal_::STOCK_SEVERITY_LEVELS_.keys
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
208
|
-
|
|
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
|
-
|
|
12
|
-
|
|
11
|
+
# @!visibility private
|
|
12
|
+
def self.included receiver # :nodoc:
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
receiver.extend self
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
::Pantheios::Core.register_include self, receiver
|
|
17
|
+
end
|
|
18
18
|
|
|
19
19
|
end # module ApplicationLayer
|
|
20
20
|
end # module Pantheios
|