console 1.16.2 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +24 -9
- 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: 5a1588810973b2d219accb3bbb33005311b4c214c052c877a601ed8c9cbeaff8
|
4
|
+
data.tar.gz: b2cb63cd0c9fa5e136455f5367fd3b8c47896ae04b0f73aa2fe72604af725e2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 964c9e0a5362a89d6bbf103d8a16a7f0c29eb5a032fc24d92d5339909bdd76970404640de776d097bd5d1f9b633270d4da67baa3bd2cc69f0cb59ab0564e8217
|
7
|
+
data.tar.gz: 4e3cb21047824f715dbc13e98707c6aebc641ebf304c5e11e22c72cf4786102ffeb0690693d23194b45933991bf8de6fc38559f89a0da5a55a10afc2c5df665c
|
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.style(:blue)
|
67
|
+
@terminal[:value] = @terminal.style(:blue)
|
68
|
+
|
64
69
|
self.register_defaults(@terminal)
|
65
70
|
end
|
66
71
|
|
@@ -90,18 +95,16 @@ module Console
|
|
90
95
|
|
91
96
|
buffer = Buffer.new("#{indent}| ")
|
92
97
|
|
93
|
-
|
94
|
-
|
98
|
+
format_subject(severity, prefix, subject, buffer)
|
99
|
+
|
100
|
+
arguments.each do |argument|
|
101
|
+
format_argument(argument, buffer)
|
95
102
|
end
|
96
103
|
|
97
104
|
if options&.any?
|
98
105
|
format_options(options, buffer)
|
99
106
|
end
|
100
107
|
|
101
|
-
arguments.each do |argument|
|
102
|
-
format_argument(argument, buffer)
|
103
|
-
end
|
104
|
-
|
105
108
|
if block_given?
|
106
109
|
if block.arity.zero?
|
107
110
|
format_argument(yield, buffer)
|
@@ -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].to_s
|
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.0
|
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-05 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
|