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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f62d11f02c39c77ce9378fae3b113e7df74da2a52c6e553af21f815a863bd3e
|
|
4
|
+
data.tar.gz: e11f1eb6fbf8f8744bb1009fc01afffb69d62398e6a0fee0b3e72e6a701af506
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8239a901cef7fe82e5f9ed464bd05bf39e03281e22213ea1a120446742071b23c7925ae0dd0ce574397d551692bf366d23589fddbef8fd3421f2f48071cad1d
|
|
7
|
+
data.tar.gz: 94656ef30b7dadcec2d02119cf44383935baf7875d5b0a43fa9ef14e923f7e2a2ebaf743d641f012399ed78a6395f9047f3521f29e1d6c1285e81c12e84f8392
|
data/CHANGES.md
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
# Pantheios.Ruby - Changes <!-- omit in toc -->
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## 0.22.3 - 30th August 2026
|
|
5
|
+
|
|
6
|
+
* updated `Updated:` metadata and copyright year ranges in all touched files
|
|
7
|
+
carrying those header fields;
|
|
8
|
+
* preserved the 2019 transfer of copyright from **Synesis Software** to
|
|
9
|
+
**Synesis Information Systems**, adding missing current-owner lines where
|
|
10
|
+
required;
|
|
11
|
+
* converted all **Ruby** source, example, and test files from tabs to
|
|
12
|
+
two-space indentation;
|
|
13
|
+
* added the `warnings` branch to the **Ruby** workflow trigger;
|
|
14
|
+
* updated **pantheios-ruby.gemspec** to centralise the project URL for
|
|
15
|
+
homepage and metadata URIs, and raised the **xqsr3** development dependency
|
|
16
|
+
floor;
|
|
17
|
+
* updated **lib/pantheios/version.rb** for release 0.22.3;
|
|
18
|
+
* removed unused local-variable assignments from **simple_file_log_service.rb** and
|
|
19
|
+
**standard_log_service_adapter.rb**;
|
|
20
|
+
* corrected ambiguous regular-expression syntax in **tc_simple_file_log_service.rb**
|
|
21
|
+
and **tc_standard_log_service_adapter.rb**;
|
|
22
|
+
* removed an unused process-ID assignment from **tc_standard_log_service_adapter.rb**;
|
|
23
|
+
* removed unused loop and instance assignments from example and performance
|
|
24
|
+
programs;
|
|
25
|
+
* warning-mode unit tests now complete without warnings;
|
|
26
|
+
* guarded and initialised lazily accessed instance variables to eliminate
|
|
27
|
+
Ruby 2.7 warnings;
|
|
28
|
+
|
|
29
|
+
|
|
4
30
|
## 0.22.2 - 27th August 2026
|
|
5
31
|
|
|
6
32
|
* renamed **Pantheios.Ruby.gemspec** to **pantheios-ruby.gemspec** so the filename stem matches `spec.name`;
|
data/NEWS.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
| Date | News Item |
|
|
4
4
|
| ------------------ | ----------------------------------------------------------------------------------------------- |
|
|
5
|
+
| 30th August 2026 | [**Pantheios.Ruby** 0.22.3](https://github.com/synesissoftware/Pantheios.Ruby/releases/tag/0.22.3) |
|
|
5
6
|
| 27th August 2026 | [**Pantheios.Ruby** 0.22.2](https://github.com/synesissoftware/Pantheios.Ruby/releases/tag/0.22.2) |
|
|
6
7
|
| 15th August 2026 | [**Pantheios.Ruby** 0.22.1](https://github.com/synesissoftware/Pantheios.Ruby/releases/tag/0.22.1) |
|
|
7
8
|
| 5th June 2020 | [**Pantheios.Ruby** 0.22.0.2](https://github.com/synesissoftware/Pantheios.Ruby/releases/tag/0.22.0.2) |
|
data/TODO.md
CHANGED
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
## Functional improvements
|
|
5
5
|
|
|
6
|
-
* [
|
|
7
|
-
|
|
6
|
+
* [x] ~~~quiet unused-variable warnings in **simple_file_log_service.rb**
|
|
7
|
+
(`logger_init_options`) and **standard_log_service_adapter.rb** (`sym`)~~~;
|
|
8
|
+
* [x] ~~~quiet **Warnings** job noise in tests: unused `pid` in
|
|
9
|
+
**tc_standard_log_service_adapter.rb**; ambiguous `/` in
|
|
10
|
+
**tc_simple_file_log_service.rb** and **tc_standard_log_service_adapter.rb**~~~;
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
## Performance improvements
|
|
@@ -29,7 +29,7 @@ LEVELS = %i{ violation alert critical failure warning notice informational debug
|
|
|
29
29
|
|
|
30
30
|
LEVELS.each do |level|
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
log(level, "logging level #{level}")
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# ############################## end of file ############################# #
|
|
@@ -14,46 +14,46 @@ module Organisation
|
|
|
14
14
|
|
|
15
15
|
module Helpers
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
include ::Pantheios
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
def with_trace
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
trace
|
|
22
|
+
end
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
def with_debug0; log(:debug0); end
|
|
25
|
+
def with_debug1; log(:debug1); end
|
|
26
|
+
def with_informational; log(:informational); end
|
|
27
|
+
def with_notice; log(:notice); end
|
|
28
|
+
def with_warning; log(:warning); end
|
|
29
|
+
def with_failure; log(:failure); end
|
|
30
|
+
def with_critical; log(:critical); end
|
|
31
|
+
def with_alert; log(:alert); end
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
def helper1
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
trace
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
with_debug0
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
with_notice
|
|
40
|
+
end
|
|
41
41
|
|
|
42
42
|
end # module Helpers
|
|
43
43
|
|
|
44
44
|
class OrgClass
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
include Helpers
|
|
47
|
+
include ::Pantheios
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
def initialize()
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
trace
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
log(:debug2) { 'initialised instance of OrgClass' }
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
helper1
|
|
56
|
+
end
|
|
57
57
|
|
|
58
58
|
end # class OrgClas
|
|
59
59
|
|
|
@@ -79,25 +79,25 @@ SUPPRESSED_SEVERITIES = %i{
|
|
|
79
79
|
|
|
80
80
|
def detect_suppression argv
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
argv.each do |arg|
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
SUPPRESSED_SEVERITIES << arg.to_sym
|
|
85
|
+
end
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
class FrontEnd
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
def severity_logged? severity
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
case severity
|
|
93
|
+
when ::Symbol
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
!SUPPRESSED_SEVERITIES.include?(severity)
|
|
96
|
+
else
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
true
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
Pantheios::Core.set_front_end FrontEnd.new
|
|
@@ -125,7 +125,7 @@ with_alert
|
|
|
125
125
|
|
|
126
126
|
log(:info) { "Creating instance of OrgClass" }
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
Organisation::OrgClass.new
|
|
129
129
|
|
|
130
130
|
# ############################## end of file ############################# #
|
|
131
131
|
|
data/examples/simple_logging.rb
CHANGED
|
@@ -29,7 +29,7 @@ LEVELS = %i{ violation alert critical failure warning notice informational debug
|
|
|
29
29
|
|
|
30
30
|
LEVELS.each do |level|
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
log(level, "logging level #{level}")
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# ############################## end of file ############################# #
|
|
@@ -40,7 +40,7 @@ Pantheios::Core.set_front_end Pantheios::FrontEnds::ThresholdFrontEnd.new thresh
|
|
|
40
40
|
|
|
41
41
|
LEVELS.each do |level|
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
log(level, "logging level #{level}")
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
# ############################## end of file ############################# #
|
data/lib/pantheios/api.rb
CHANGED
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
# Purpose: The Pantheios.Ruby API (::Pantheios::API)
|
|
6
6
|
#
|
|
7
7
|
# Created: 2nd April 2011
|
|
8
|
-
# Updated:
|
|
8
|
+
# Updated: 28th August 2026
|
|
9
9
|
#
|
|
10
10
|
# Home: https://github.com/synesissoftware/Pantheios.Ruby
|
|
11
11
|
#
|
|
12
12
|
# Author: Matthew Wilson
|
|
13
13
|
#
|
|
14
|
+
# Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
|
|
14
15
|
# Copyright (c) 2011-2019, Matthew Wilson and Synesis Software
|
|
15
16
|
# All rights reserved.
|
|
16
17
|
#
|
|
@@ -77,219 +78,219 @@ module Pantheios
|
|
|
77
78
|
# - prefix
|
|
78
79
|
module API
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
# Logs an arbitrary set of parameters at the given severity level
|
|
82
|
+
def log severity, *args, &block
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
return nil unless severity_logged? severity
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
log_or_trace_with_block_ 1, severity, args, &block
|
|
87
|
+
end
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
# Logs an array of parameters at the given severity level
|
|
90
|
+
def log_v severity, argv, &block
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
return nil unless severity_logged? severity
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
log_or_trace_with_block_ 1, severity, argv, &block
|
|
95
|
+
end
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
# Logs an arbitrary set of parameters at the Trace (:trace) level
|
|
98
|
+
def trace *args, &block
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
return nil unless tracing?
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
trace_with_block_ 1, args, &block
|
|
103
|
+
end
|
|
103
104
|
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
# Logs an array of parameters at the Trace (:trace) level
|
|
106
|
+
def trace_v argv, &block
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
return nil unless tracing?
|
|
108
109
|
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
trace_with_block_ 1, argv, &block
|
|
111
|
+
end
|
|
111
112
|
|
|
112
|
-
|
|
113
|
+
if Util::VersionUtil.version_compare(RUBY_VERSION, [ 2, 1 ]) >= 0
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
def trace_blv b, lvars, &block
|
|
115
116
|
|
|
116
|
-
|
|
117
|
+
return nil unless tracing?
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
::Pantheios::Core.trace_v_impl(self, 1, ApplicationLayer::ParamNameList[*lvars], :trace, lvars.map { |lv| b.local_variable_get(lv) }, &block)
|
|
120
|
+
end
|
|
121
|
+
end # RUBY_VERSION
|
|
121
122
|
|
|
122
|
-
|
|
123
|
+
if Util::VersionUtil.version_compare(RUBY_VERSION, [ 2, 2 ]) >= 0
|
|
123
124
|
|
|
124
|
-
|
|
125
|
+
def trace_b b, &block
|
|
125
126
|
|
|
126
|
-
|
|
127
|
+
return nil unless tracing?
|
|
127
128
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
::Pantheios::Core.trace_v_impl(self, 1, ApplicationLayer::ParamNameList[*b.local_variables], :trace, b.local_variables.map { |lv| b.local_variable_get(lv) }, &block)
|
|
130
|
+
end
|
|
131
|
+
end # RUBY_VERSION
|
|
131
132
|
|
|
132
133
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
134
|
+
# Determines whether a given severity is logged
|
|
135
|
+
#
|
|
136
|
+
# === Signature
|
|
137
|
+
#
|
|
138
|
+
# * *Parameters:*
|
|
139
|
+
# - +severity+:: The severity level, which should be a known log
|
|
140
|
+
# severity symbol or an integral equivalent
|
|
141
|
+
#
|
|
142
|
+
# * *Returns:*
|
|
143
|
+
# a +truey+ value if the severity should be logged; a +falsey+ value
|
|
144
|
+
# otherwise
|
|
145
|
+
def severity_logged? severity
|
|
145
146
|
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
::Pantheios::Core.severity_logged? severity
|
|
148
|
+
end
|
|
148
149
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
# Determines whether tracing (severity == :trace) is enabled. This is
|
|
151
|
+
# used in the trace methods (+trace+, +trace_v+, +trace_blv+, +trace_b+)
|
|
152
|
+
# and therefore it may be overridden independently of +severity_logged?+
|
|
153
|
+
def tracing?
|
|
153
154
|
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
severity_logged? :trace
|
|
156
|
+
end
|
|
156
157
|
|
|
157
158
|
|
|
158
159
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
160
|
+
# Defines the ordered list of log-statement elements
|
|
161
|
+
#
|
|
162
|
+
# === Elements
|
|
163
|
+
#
|
|
164
|
+
# Elements can be one of:
|
|
165
|
+
# - +:process_name+
|
|
166
|
+
# - +:process_id+
|
|
167
|
+
# - +:severity+
|
|
168
|
+
# - +:thread_id+
|
|
169
|
+
# - +:timestamp+
|
|
170
|
+
#
|
|
171
|
+
# This is called from +prefix+
|
|
172
|
+
def prefix_elements
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
[ :process_name, :thread_id, :timestamp, :severity ]
|
|
175
|
+
end
|
|
175
176
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
# Obtains the process id
|
|
178
|
+
#
|
|
179
|
+
# Unless overridden, returns the value provided by
|
|
180
|
+
# +::Pantheios::Core::process_id+
|
|
181
|
+
def process_id
|
|
181
182
|
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
::Pantheios::Core.process_id
|
|
184
|
+
end
|
|
184
185
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
# Obtains the program name
|
|
187
|
+
#
|
|
188
|
+
# Unless overridden, returns the value provided by
|
|
189
|
+
# +::Pantheios::Core::process_name+
|
|
190
|
+
def process_name
|
|
190
191
|
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
::Pantheios::Core.process_name
|
|
193
|
+
end
|
|
193
194
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
# Obtains the string corresponding to the severity
|
|
196
|
+
#
|
|
197
|
+
# Unless overridden, returns the value provided by
|
|
198
|
+
# +::Pantheios::Core::severity_string+
|
|
199
|
+
def severity_string severity
|
|
199
200
|
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
::Pantheios::Core.severity_string severity
|
|
202
|
+
end
|
|
202
203
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
# Obtains the thread id
|
|
205
|
+
#
|
|
206
|
+
# Unless overridden, returns the value provided by
|
|
207
|
+
# +::Pantheios::Core::thread_id+
|
|
208
|
+
def thread_id
|
|
208
209
|
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
::Pantheios::Core.thread_id
|
|
211
|
+
end
|
|
211
212
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
# Obtains a string-form of the timestamp
|
|
214
|
+
#
|
|
215
|
+
# Unless overridden, returns the value provided by
|
|
216
|
+
# +::Pantheios::Core::timestamp+
|
|
217
|
+
def timestamp t
|
|
217
218
|
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
::Pantheios::Core.timestamp t, nil
|
|
220
|
+
end
|
|
220
221
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
222
|
+
# Assembles the prefix according to +prefix_elements+ into an array of
|
|
223
|
+
# parts
|
|
224
|
+
#
|
|
225
|
+
# * *Parameters:*
|
|
226
|
+
# - +t+ [ Date, Time, DateTime ] The timestamp of the log entry
|
|
227
|
+
# - +severity+ The severity
|
|
228
|
+
def prefix_parts t, severity
|
|
228
229
|
|
|
229
|
-
|
|
230
|
+
prefix_elements.map do |el|
|
|
230
231
|
|
|
231
|
-
|
|
232
|
-
|
|
232
|
+
case el
|
|
233
|
+
when :program_name, :process_name
|
|
233
234
|
|
|
234
|
-
|
|
235
|
-
|
|
235
|
+
process_name
|
|
236
|
+
when :process_id
|
|
236
237
|
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
process_id
|
|
239
|
+
when :severity
|
|
239
240
|
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
severity_string severity
|
|
242
|
+
when :thread_id
|
|
242
243
|
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
thread_id
|
|
245
|
+
when :timestamp
|
|
245
246
|
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
timestamp t
|
|
248
|
+
else
|
|
248
249
|
|
|
249
|
-
|
|
250
|
+
s = ::Symbol === el ? ":#{el}" : el.to_s
|
|
250
251
|
|
|
251
|
-
|
|
252
|
+
warn "ignoring unrecognised prefix_element '#{s}'"
|
|
252
253
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
nil
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
end
|
|
257
258
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
259
|
+
# Assembles the +prefix_parts+ into a string
|
|
260
|
+
#
|
|
261
|
+
# * *Parameters:*
|
|
262
|
+
# - +t+ [ Date, Time, DateTime ] The timestamp of the log entry
|
|
263
|
+
# - +severity+ The severity
|
|
264
|
+
def prefix t, severity
|
|
264
265
|
|
|
265
|
-
|
|
266
|
-
|
|
266
|
+
prefix_parts(t, severity).join(', ')
|
|
267
|
+
end
|
|
267
268
|
|
|
268
|
-
|
|
269
|
-
|
|
269
|
+
# @!visibility private
|
|
270
|
+
def self.included receiver # :nodoc:
|
|
270
271
|
|
|
271
|
-
|
|
272
|
+
receiver.extend self
|
|
272
273
|
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
::Pantheios::Core.register_include self, receiver
|
|
275
|
+
end
|
|
275
276
|
|
|
276
|
-
|
|
277
|
+
private
|
|
277
278
|
|
|
278
|
-
|
|
279
|
-
|
|
279
|
+
# Private implementation method that should not need to be overridden
|
|
280
|
+
def log_or_trace_with_block_ call_depth, severity, argv, &block
|
|
280
281
|
|
|
281
|
-
|
|
282
|
+
if :trace == severity
|
|
282
283
|
|
|
283
|
-
|
|
284
|
-
|
|
284
|
+
return ::Pantheios::Core.trace_v_impl self, 1 + call_depth, nil, severity, argv, &block
|
|
285
|
+
end
|
|
285
286
|
|
|
286
|
-
|
|
287
|
-
|
|
287
|
+
::Pantheios::Core.log_v_impl self, severity, argv, &block
|
|
288
|
+
end
|
|
288
289
|
|
|
289
|
-
|
|
290
|
+
def trace_with_block_ call_depth, argv, &block
|
|
290
291
|
|
|
291
|
-
|
|
292
|
-
|
|
292
|
+
return ::Pantheios::Core.trace_v_impl self, 1 + call_depth, nil, :trace, argv, &block
|
|
293
|
+
end
|
|
293
294
|
|
|
294
295
|
end # module API
|
|
295
296
|
end # module Pantheios
|