console 1.15.3 → 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/bake/console.rb +3 -0
- data/lib/console/buffer.rb +2 -19
- data/lib/console/capture.rb +13 -19
- data/lib/console/clock.rb +6 -23
- data/lib/console/compatible/logger.rb +2 -19
- data/lib/console/event/failure.rb +3 -20
- data/lib/console/event/generic.rb +2 -19
- data/lib/console/event/progress.rb +2 -19
- data/lib/console/event/spawn.rb +2 -19
- data/lib/console/event.rb +2 -20
- data/lib/console/filter.rb +11 -25
- data/lib/console/logger.rb +6 -31
- data/lib/console/output/default.rb +2 -19
- data/lib/console/output/json.rb +2 -19
- data/lib/console/output/sensitive.rb +2 -19
- data/lib/console/output/split.rb +28 -0
- data/lib/console/output/text.rb +2 -19
- data/lib/console/output/xterm.rb +2 -19
- data/lib/console/output.rb +2 -19
- data/lib/console/progress.rb +8 -25
- data/lib/console/resolver.rb +3 -19
- data/lib/console/serialized/logger.rb +8 -19
- data/lib/console/split.rb +5 -38
- data/lib/console/terminal/logger.rb +27 -28
- data/lib/console/terminal/text.rb +2 -19
- data/lib/console/terminal/xterm.rb +4 -21
- data/lib/console/terminal.rb +2 -19
- data/lib/console/version.rb +3 -20
- data/lib/console.rb +5 -20
- data/license.md +27 -0
- data/readme.md +31 -0
- data.tar.gz.sig +0 -0
- metadata +69 -40
- metadata.gz.sig +0 -0
- data/lib/console/event/measure.rb +0 -44
- data/lib/console/event/metric.rb +0 -60
- data/lib/console/measure.rb +0 -51
data/lib/console/progress.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require_relative 'event/progress'
|
24
7
|
require_relative 'clock'
|
@@ -29,14 +12,14 @@ module Console
|
|
29
12
|
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
30
13
|
end
|
31
14
|
|
32
|
-
def initialize(output, subject, total = 0, minimum_output_duration: 1
|
15
|
+
def initialize(output, subject, total = 0, minimum_output_duration: 0.1)
|
33
16
|
@output = output
|
34
17
|
@subject = subject
|
35
18
|
|
36
19
|
@start_time = Progress.now
|
37
20
|
|
38
21
|
@last_output_time = nil
|
39
|
-
@minimum_output_duration =
|
22
|
+
@minimum_output_duration = minimum_output_duration
|
40
23
|
|
41
24
|
@current = 0
|
42
25
|
@total = total
|
@@ -50,8 +33,8 @@ module Console
|
|
50
33
|
Progress.now - @start_time
|
51
34
|
end
|
52
35
|
|
53
|
-
def
|
54
|
-
@current.to_f
|
36
|
+
def ratio
|
37
|
+
Rational(@current.to_f, @total.to_f)
|
55
38
|
end
|
56
39
|
|
57
40
|
def remaining
|
@@ -90,8 +73,8 @@ module Console
|
|
90
73
|
return self
|
91
74
|
end
|
92
75
|
|
93
|
-
def mark(
|
94
|
-
@output.info(@subject,
|
76
|
+
def mark(...)
|
77
|
+
@output.info(@subject, ...)
|
95
78
|
end
|
96
79
|
|
97
80
|
def to_s
|
data/lib/console/resolver.rb
CHANGED
@@ -1,24 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
5
|
+
# Copyright, 2021, by Robert Schulze.
|
22
6
|
|
23
7
|
require_relative 'filter'
|
24
8
|
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require_relative '../buffer'
|
24
7
|
require_relative '../filter'
|
@@ -26,6 +9,8 @@ require_relative '../filter'
|
|
26
9
|
require 'time'
|
27
10
|
require 'json'
|
28
11
|
|
12
|
+
require 'fiber/annotation'
|
13
|
+
|
29
14
|
module Console
|
30
15
|
module Serialized
|
31
16
|
class Logger
|
@@ -61,6 +46,10 @@ module Console
|
|
61
46
|
record[:subject] = subject
|
62
47
|
end
|
63
48
|
|
49
|
+
if annotation = Fiber.current.annotation
|
50
|
+
record[:annotation] = annotation
|
51
|
+
end
|
52
|
+
|
64
53
|
message = arguments
|
65
54
|
|
66
55
|
if block_given?
|
data/lib/console/split.rb
CHANGED
@@ -1,43 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
5
|
+
|
6
|
+
require_relative 'output/split'
|
22
7
|
|
23
8
|
module Console
|
24
|
-
|
25
|
-
def self.[] *outputs
|
26
|
-
self.new(outputs)
|
27
|
-
end
|
28
|
-
|
29
|
-
def initialize(outputs)
|
30
|
-
@outputs = outputs
|
31
|
-
end
|
32
|
-
|
33
|
-
def verbose!(value = true)
|
34
|
-
@outputs.each{|output| output.verbose!(value)}
|
35
|
-
end
|
36
|
-
|
37
|
-
def call(level, subject = nil, *arguments, **options, &block)
|
38
|
-
@outputs.each do |output|
|
39
|
-
output.call(level, subject, *arguments, **options, &block)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
9
|
+
Split = Output::Split
|
43
10
|
end
|
@@ -1,33 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
5
|
+
# Copyright, 2021, by Robert Schulze.
|
22
6
|
|
23
7
|
require_relative '../buffer'
|
24
8
|
require_relative '../event'
|
9
|
+
require_relative '../clock'
|
25
10
|
|
26
11
|
require_relative 'text'
|
27
12
|
require_relative 'xterm'
|
28
13
|
|
29
14
|
require 'json'
|
30
15
|
require 'fiber'
|
16
|
+
require 'fiber/annotation'
|
31
17
|
|
32
18
|
module Console
|
33
19
|
module Terminal
|
@@ -77,6 +63,9 @@ module Console
|
|
77
63
|
@terminal[:error] = @terminal.style(:red)
|
78
64
|
@terminal[:fatal] = @terminal[:error]
|
79
65
|
|
66
|
+
@terminal[:annotation] = @terminal.style(:blue)
|
67
|
+
@terminal[:value] = @terminal.style(:blue)
|
68
|
+
|
80
69
|
self.register_defaults(@terminal)
|
81
70
|
end
|
82
71
|
|
@@ -106,18 +95,16 @@ module Console
|
|
106
95
|
|
107
96
|
buffer = Buffer.new("#{indent}| ")
|
108
97
|
|
109
|
-
|
110
|
-
|
98
|
+
format_subject(severity, prefix, subject, buffer)
|
99
|
+
|
100
|
+
arguments.each do |argument|
|
101
|
+
format_argument(argument, buffer)
|
111
102
|
end
|
112
103
|
|
113
104
|
if options&.any?
|
114
105
|
format_options(options, buffer)
|
115
106
|
end
|
116
107
|
|
117
|
-
arguments.each do |argument|
|
118
|
-
format_argument(argument, buffer)
|
119
|
-
end
|
120
|
-
|
121
108
|
if block_given?
|
122
109
|
if block.arity.zero?
|
123
110
|
format_argument(yield, buffer)
|
@@ -142,7 +129,9 @@ module Console
|
|
142
129
|
when Event::Generic
|
143
130
|
argument.format(output, @terminal, @verbose)
|
144
131
|
else
|
145
|
-
|
132
|
+
argument.to_s.each_line do |line|
|
133
|
+
output.puts line
|
134
|
+
end
|
146
135
|
end
|
147
136
|
end
|
148
137
|
|
@@ -157,13 +146,23 @@ module Console
|
|
157
146
|
end
|
158
147
|
|
159
148
|
def default_suffix(object = nil)
|
160
|
-
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
|
161
158
|
|
162
159
|
if object
|
163
160
|
buffer << "[oid=0x#{object.object_id.to_s(16)}] "
|
164
161
|
end
|
165
162
|
|
166
163
|
buffer << "[ec=0x#{Fiber.current.object_id.to_s(16)}] [pid=#{Process.pid}] [#{::Time.now}]#{@terminal.reset}"
|
164
|
+
|
165
|
+
return buffer
|
167
166
|
end
|
168
167
|
|
169
168
|
def format_object_subject(severity, prefix, subject, output)
|
@@ -194,7 +193,7 @@ module Console
|
|
194
193
|
string = value.to_s
|
195
194
|
|
196
195
|
string.each_line do |line|
|
197
|
-
output.puts "#{line}"
|
196
|
+
output.puts "#{@terminal[:value]}#{line}#{@terminal.reset}"
|
198
197
|
end
|
199
198
|
end
|
200
199
|
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require 'io/console'
|
24
7
|
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require 'io/console'
|
24
7
|
|
@@ -38,7 +21,7 @@ module Console
|
|
38
21
|
cyan: 6,
|
39
22
|
white: 7,
|
40
23
|
default: 9,
|
41
|
-
}
|
24
|
+
}.freeze
|
42
25
|
|
43
26
|
ATTRIBUTES = {
|
44
27
|
normal: 0,
|
@@ -50,7 +33,7 @@ module Console
|
|
50
33
|
blink: 5,
|
51
34
|
reverse: 7,
|
52
35
|
hidden: 8,
|
53
|
-
}
|
36
|
+
}.freeze
|
54
37
|
|
55
38
|
def colors?
|
56
39
|
true
|
data/lib/console/terminal.rb
CHANGED
@@ -1,23 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require_relative 'terminal/logger'
|
data/lib/console/version.rb
CHANGED
@@ -1,25 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
10
|
-
# furnished to do so, subject to the following conditions:
|
11
|
-
#
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
13
|
-
# all copies or substantial portions of the Software.
|
14
|
-
#
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
module Console
|
24
|
-
VERSION = "1.
|
7
|
+
VERSION = "1.17.0"
|
25
8
|
end
|
data/lib/console.rb
CHANGED
@@ -1,25 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
4
|
-
# Copyright, 2019, by Samuel
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
# in the Software without restriction, including without limitation the rights
|
9
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
-
# copies of the Software, and to permit persons to whom the Software is
|
11
|
-
# furnished to do so, subject to the following conditions:
|
12
|
-
#
|
13
|
-
# The above copyright notice and this permission notice shall be included in
|
14
|
-
# all copies or substantial portions of the Software.
|
15
|
-
#
|
16
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
-
# THE SOFTWARE.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2019-2022, by Samuel Williams.
|
5
|
+
# Copyright, 2019, by Bryan Powell.
|
6
|
+
# Copyright, 2020, by Michael Adams.
|
7
|
+
# Copyright, 2021, by Cédric Boutillier.
|
23
8
|
|
24
9
|
require_relative 'console/version'
|
25
10
|
require_relative 'console/logger'
|
data/license.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright, 2019-2022, by Samuel Williams.
|
4
|
+
Copyright, 2019-2021, by Bryan Powell.
|
5
|
+
Copyright, 2019, by Cyril Roelandt.
|
6
|
+
Copyright, 2020, by Olle Jonsson.
|
7
|
+
Copyright, 2020, by Michael Adams.
|
8
|
+
Copyright, 2021, by Cédric Boutillier.
|
9
|
+
Copyright, 2021, by Robert Schulze.
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
13
|
+
in the Software without restriction, including without limitation the rights
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
16
|
+
furnished to do so, subject to the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
data/readme.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Console
|
2
|
+
|
3
|
+
Provides beautiful console logging for Ruby applications. Implements fast, buffered log output.
|
4
|
+
|
5
|
+
[![Development Status](https://github.com/socketry/console/workflows/Test/badge.svg)](https://github.com/socketry/console/actions?workflow=Test)
|
6
|
+
|
7
|
+
## Motivation
|
8
|
+
|
9
|
+
When Ruby decided to reverse the order of exception backtraces, I finally gave up using the built in logging and decided restore sanity to the output of my programs once and for all!
|
10
|
+
|
11
|
+
## Features
|
12
|
+
|
13
|
+
- Thread safe global logger with per-fiber context.
|
14
|
+
- Carry along context with nested loggers.
|
15
|
+
- Enable/disable log levels per-class.
|
16
|
+
- Detailed logging of exceptions.
|
17
|
+
- Beautiful logging to the terminal or structured logging using JSON.
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Please see the [project documentation](https://socketry.github.io/console).
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
We welcome contributions to this project.
|
26
|
+
|
27
|
+
1. Fork it.
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
31
|
+
5. Create new Pull Request.
|
data.tar.gz.sig
CHANGED
Binary file
|