console 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8cd747edadd12f8a9c8f01538e8e89986cb5ac6632d743f8ca4280c18166dba
4
- data.tar.gz: 4c6eb9b8ebd974af8eac9ecf7db5ac9a7998fcc8116468a0a81a4cb1b317063a
3
+ metadata.gz: dc774cc54d5e3bf9c96be4e34c314467e2ce8434a7acf7b059c24b86865ecdc6
4
+ data.tar.gz: be5c6cf385afaf2e6c9722d595c63907842839003e49aeb95e1163026a7d2639
5
5
  SHA512:
6
- metadata.gz: acd069d149e295163cf2bdf8a45b12d72ec77c677b988e0e0554fb789bf724d09284c48e181dc6927cf5590a81ac69f9e442dc186bb4caf371fac6675e0e34c8
7
- data.tar.gz: 8dc2fd1bd53a653e26190b8a818a25c80b50482eec4e2d44a572897199530ea5265349f1d3fe616cf34797f222516d1957b15ac256882ea631e708c687d74e51
6
+ metadata.gz: 6133aad107df630aa40f63f56905c1afff80837baebe78f13a5a5610c6279c41757c14b91b34e3abdb83e2f8e574720a0a0614f18808e19beb700cf6a77f84f8
7
+ data.tar.gz: f8a4fe934e7a8b3777ae94effeb61fe62b55ed0d740ea8c9030028bd2092b405d14556f077b19f1eeefad8654511b97e8bd51d8ff7a1635216071d5c304e502e
@@ -44,6 +44,9 @@ module Console
44
44
  record = {
45
45
  time: Time.now.iso8601,
46
46
  severity: severity,
47
+ class: subject.class,
48
+ oid: subject.object_id,
49
+ pid: Process.pid,
47
50
  }
48
51
 
49
52
  if subject
@@ -132,7 +132,29 @@ module Console
132
132
  end
133
133
  end
134
134
 
135
- def format_subject(severity, prefix, subject, output)
135
+ def format_subject(severity, prefix, subject, buffer)
136
+ if subject.is_a?(String)
137
+ format_string_subject(severity, prefix, subject, buffer)
138
+ elsif subject.is_a?(Module)
139
+ format_string_subject(severity, prefix, subject.to_s, buffer)
140
+ else
141
+ format_object_subject(severity, prefix, subject, buffer)
142
+ end
143
+ end
144
+
145
+ def format_object_subject(severity, prefix, subject, output)
146
+ prefix_style = @terminal[severity]
147
+
148
+ if @verbose
149
+ suffix = " #{@terminal[:logger_suffix]}[oid=0x#{subject.object_id.to_s(16)}] [pid=#{Process.pid}] [#{Time.now}]#{@terminal.reset}"
150
+ end
151
+
152
+ prefix = "#{prefix_style}#{prefix}:#{@terminal.reset} "
153
+
154
+ output.puts "#{@terminal[:subject]}#{subject.class}#{@terminal.reset}#{suffix}", prefix: prefix
155
+ end
156
+
157
+ def format_string_subject(severity, prefix, subject, output)
136
158
  prefix_style = @terminal[severity]
137
159
 
138
160
  if @verbose
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Console
22
- VERSION = "1.7.1"
22
+ VERSION = "1.7.2"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: console
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-26 00:00:00.000000000 Z
11
+ date: 2020-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: covered