console 1.16.2 → 1.17.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
- checksums.yaml.gz.sig +0 -0
- data/lib/console/filter.rb +1 -1
- data/lib/console/serialized/logger.rb +6 -0
- data/lib/console/terminal/logger.rb +25 -10
- data/lib/console/terminal/xterm.rb +2 -2
- data/lib/console/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +18 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 689cedcf29ff2b68070c411deb10790350808468c1ad3dde6857522e9d87cd0c
|
4
|
+
data.tar.gz: afb2b73337d57ffb59b41281f81736b30ba646a58925663fbb7f8bf356d65dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86d91efd799280a3e88fd0199ace0b305789f02ba55a658aa3c6baf2d1b31969658d0f946463d0220c3e2f032f62b62c3a6226753db49935d6a3dc7983cc3717
|
7
|
+
data.tar.gz: bba2266b438742f21cf0819db3e948509d354f4c4477a032218b529f2efd0d12577956eb46adb364365f80cc4079587d4d615d217b124e0c230c9543b642261a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/console/filter.rb
CHANGED
@@ -9,6 +9,8 @@ require_relative '../filter'
|
|
9
9
|
require 'time'
|
10
10
|
require 'json'
|
11
11
|
|
12
|
+
require 'fiber/annotation'
|
13
|
+
|
12
14
|
module Console
|
13
15
|
module Serialized
|
14
16
|
class Logger
|
@@ -44,6 +46,10 @@ module Console
|
|
44
46
|
record[:subject] = subject
|
45
47
|
end
|
46
48
|
|
49
|
+
if annotation = Fiber.current.annotation
|
50
|
+
record[:annotation] = annotation
|
51
|
+
end
|
52
|
+
|
47
53
|
message = arguments
|
48
54
|
|
49
55
|
if block_given?
|
@@ -6,12 +6,14 @@
|
|
6
6
|
|
7
7
|
require_relative '../buffer'
|
8
8
|
require_relative '../event'
|
9
|
+
require_relative '../clock'
|
9
10
|
|
10
11
|
require_relative 'text'
|
11
12
|
require_relative 'xterm'
|
12
13
|
|
13
14
|
require 'json'
|
14
15
|
require 'fiber'
|
16
|
+
require 'fiber/annotation'
|
15
17
|
|
16
18
|
module Console
|
17
19
|
module Terminal
|
@@ -61,6 +63,9 @@ module Console
|
|
61
63
|
@terminal[:error] = @terminal.style(:red)
|
62
64
|
@terminal[:fatal] = @terminal[:error]
|
63
65
|
|
66
|
+
@terminal[:annotation] = @terminal.reset
|
67
|
+
@terminal[:value] = @terminal.style(:blue)
|
68
|
+
|
64
69
|
self.register_defaults(@terminal)
|
65
70
|
end
|
66
71
|
|
@@ -90,13 +95,7 @@ module Console
|
|
90
95
|
|
91
96
|
buffer = Buffer.new("#{indent}| ")
|
92
97
|
|
93
|
-
|
94
|
-
format_subject(severity, prefix, subject, buffer)
|
95
|
-
end
|
96
|
-
|
97
|
-
if options&.any?
|
98
|
-
format_options(options, buffer)
|
99
|
-
end
|
98
|
+
format_subject(severity, prefix, subject, buffer)
|
100
99
|
|
101
100
|
arguments.each do |argument|
|
102
101
|
format_argument(argument, buffer)
|
@@ -110,6 +109,10 @@ module Console
|
|
110
109
|
end
|
111
110
|
end
|
112
111
|
|
112
|
+
if options&.any?
|
113
|
+
format_options(options, buffer)
|
114
|
+
end
|
115
|
+
|
113
116
|
@io.write buffer.string
|
114
117
|
end
|
115
118
|
|
@@ -126,7 +129,9 @@ module Console
|
|
126
129
|
when Event::Generic
|
127
130
|
argument.format(output, @terminal, @verbose)
|
128
131
|
else
|
129
|
-
|
132
|
+
argument.to_s.each_line do |line|
|
133
|
+
output.puts line
|
134
|
+
end
|
130
135
|
end
|
131
136
|
end
|
132
137
|
|
@@ -141,13 +146,23 @@ module Console
|
|
141
146
|
end
|
142
147
|
|
143
148
|
def default_suffix(object = nil)
|
144
|
-
buffer = +"
|
149
|
+
buffer = +""
|
150
|
+
|
151
|
+
if @verbose
|
152
|
+
if annotation = Fiber.current.annotation and annotation.size > 0
|
153
|
+
buffer << ": #{@terminal[:annotation]}#{annotation}#{@terminal.reset}"
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
buffer << " #{@terminal[:logger_suffix]}"
|
145
158
|
|
146
159
|
if object
|
147
160
|
buffer << "[oid=0x#{object.object_id.to_s(16)}] "
|
148
161
|
end
|
149
162
|
|
150
163
|
buffer << "[ec=0x#{Fiber.current.object_id.to_s(16)}] [pid=#{Process.pid}] [#{::Time.now}]#{@terminal.reset}"
|
164
|
+
|
165
|
+
return buffer
|
151
166
|
end
|
152
167
|
|
153
168
|
def format_object_subject(severity, prefix, subject, output)
|
@@ -178,7 +193,7 @@ module Console
|
|
178
193
|
string = value.to_s
|
179
194
|
|
180
195
|
string.each_line do |line|
|
181
|
-
output.puts "#{line}"
|
196
|
+
output.puts "#{@terminal[:value]}#{line}#{@terminal.reset}"
|
182
197
|
end
|
183
198
|
end
|
184
199
|
|
data/lib/console/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -43,7 +43,7 @@ cert_chain:
|
|
43
43
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
44
44
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
45
45
|
-----END CERTIFICATE-----
|
46
|
-
date:
|
46
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
47
47
|
dependencies:
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: fiber-local
|
@@ -59,6 +59,20 @@ dependencies:
|
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: fiber-annotation
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
type: :runtime
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
62
76
|
- !ruby/object:Gem::Dependency
|
63
77
|
name: bake
|
64
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,14 +206,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
206
|
requirements:
|
193
207
|
- - ">="
|
194
208
|
- !ruby/object:Gem::Version
|
195
|
-
version:
|
209
|
+
version: 2.7.3
|
196
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
211
|
requirements:
|
198
212
|
- - ">="
|
199
213
|
- !ruby/object:Gem::Version
|
200
214
|
version: '0'
|
201
215
|
requirements: []
|
202
|
-
rubygems_version: 3.
|
216
|
+
rubygems_version: 3.4.7
|
203
217
|
signing_key:
|
204
218
|
specification_version: 4
|
205
219
|
summary: Beautiful logging for Ruby.
|
metadata.gz.sig
CHANGED
Binary file
|